This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

VB script setting user exchange protocols

 Hello all

a long time ago we setup a VB Script in ARS, which checks group memberships and sets the OWA Protocol Setting on/off for users.

Now we want to set all the other possible protocols with this script.

 

This is the piece that sets the current OWA Flag.

 

     End If
                        Next
                        ' Set field "protocolsettings"
                        If strIsMember = "1" Then
                             objUser.Put "protocolSettings", "HTTP§1§1§§§§§§"
                             objUser.SetInfo
                        Else
                             objUser.Put "protocolSettings", "HTTP§0§1§§§§§§"
                             objUser.SetInfo
                        End If
                  Next

 

I have no idea where to find the information for all the other protocols how they are named to set them.

I did not create this original script back then.

Parents
  • You really should consider doing this with Powershell rather than VB. Quest has long promoted the idea that Powershell is the preferred direction for coding in ActiveRoles.

    Here's a Msft KB that talks about how to set these (very easy!):

    support.microsoft.com/.../how-to-enable-or-disable-imap,-pop,-owa,-mapi,-or-exchange-activesync-for-a-mailbox-in-exchange-server

    Then it's just a matter of launching an Exchange Posh session in your code:

    # Build up the $UserCredential to launch the Exchange PoSh session

    #<find code on Google for this>

    # Invoke Exchange PoSh

    $ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
    Import-PSSession $ExchangeSession

    # Build up rule code to determine which protocol(s) to enable

    # Example

    If (<something is true>)
    {
    $POPFlagState = $true
    }

    If (<something is true>)
    {
    $IMAPFlagState = $true
    }

    # ...and so on

    # Set the protocols in Exchange

    # $UserIdentifier will probably come from the currently processed AR $Request so...

    # $Dirobj.get will obtain the e-mail address of the ActiveRoles in-process user

    $UserIdentifer = $Dirobj.get("mail")

    Set-CasMailbox $UserIdentifier -PopEnabled $POPFlagState -IMAPEnabled $IMAPFlagState -MAPIEnabled $MAPIFlagState -OWAEnabled $OWAFlagState -ActiveSyncEnabled $ActiveSyncFlagState
Reply
  • You really should consider doing this with Powershell rather than VB. Quest has long promoted the idea that Powershell is the preferred direction for coding in ActiveRoles.

    Here's a Msft KB that talks about how to set these (very easy!):

    support.microsoft.com/.../how-to-enable-or-disable-imap,-pop,-owa,-mapi,-or-exchange-activesync-for-a-mailbox-in-exchange-server

    Then it's just a matter of launching an Exchange Posh session in your code:

    # Build up the $UserCredential to launch the Exchange PoSh session

    #<find code on Google for this>

    # Invoke Exchange PoSh

    $ExchangeSession = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
    Import-PSSession $ExchangeSession

    # Build up rule code to determine which protocol(s) to enable

    # Example

    If (<something is true>)
    {
    $POPFlagState = $true
    }

    If (<something is true>)
    {
    $IMAPFlagState = $true
    }

    # ...and so on

    # Set the protocols in Exchange

    # $UserIdentifier will probably come from the currently processed AR $Request so...

    # $Dirobj.get will obtain the e-mail address of the ActiveRoles in-process user

    $UserIdentifer = $Dirobj.get("mail")

    Set-CasMailbox $UserIdentifier -PopEnabled $POPFlagState -IMAPEnabled $IMAPFlagState -MAPIEnabled $MAPIFlagState -OWAEnabled $OWAFlagState -ActiveSyncEnabled $ActiveSyncFlagState
Children
No Data