Read the Powershell commands in a Provisioning

Hello Experts,

We are facing issues when we want to alter the SipAddress and the SMTP Exchange mails. We are provisioning these attributes to the Exchange side, and we know that IQService constructs a PowerShell command to communicate with Exchange. We were wondering, is there any way we can check what PowerShell command is being created by the IQService? Is there any way to log these comands via IQService?

The provisioning code is the following:

//generate new provisioning
Provisioner provisioner = new Provisioner(context);
ProvisioningPlan plan = new ProvisioningPlan();
String nativeId = getNativeIdentity(context,app,identity);
AccountRequest accReqName = new AccountRequest(AccountRequest.Operation.Modify, app, null, nativeId);
accReqName.add(new AttributeRequest(attribute,ProvisioningPlan.Operation.Set, value));

Where attribute and value change based on which attribute we’re trying to change.

To provision the Skype/Lync email we’re using:

accReqName.add(new AttributeRequest("SipAddress",ProvisioningPlan.Operation.Set, "SIP:" + emailAddress));

To provision the Exchange email we’re using:

accReqName.add(new AttributeRequest("Exch_emailAddressPolicyEnable",
ProvisioningPlan.Operation.Set, false));
Map externalEmailMap = new HashMap();
externalEmailMap.put("add", externalEmail);
accReqName.add(new AttributeRequest("Exch_EmailAddresses", ProvisioningPlan.Operation.Set, externalEmailMap));
accReqName.add(new AttributeRequest("Exch_PrimarySmtpAddress", ProvisioningPlan.Operation.Set, externalEmail));

I’ve tried setting the debug level to 3 (DEBUG) and it only returns me the request, some connections to the server, and the response. The request looks something like this:

      <entry key="Request">
          <AccountRequest application="APP NAME" nativeIdentity="IDENTITY" op="Modify">
            <AttributeRequest name="ATTRIBUTE" op="Set" value="VALUE"/>

What I wanted was this request in PowerShell commands being generated by the IQService.

Thank you,

Guilherme Russo

Hi Guilherme,

I can not provide a direct answer to your question, but we have been using our own powershell script to perform the same.
The main reason we used our own PowerShell script as changing a primary email-address requires to turn off the EmailAddressPolicy on Exchange online. Which is not done using the ‘normal’ commands used by the IQService.

Set-RemoteMailbox $UserPrincipalName -ErrorAction Stop -EmailAddressPolicyEnabled:$FALSE

For some hints take a look at:

If you have additional questions, we are here to help :slight_smile:

– Remold

Connector would be using set-csuser command internally.
The provisioning plan should be still logged in IQService. Also can you do a “sip:” (lowercase prefix). Refer Set-CsUser (SkypeForBusiness) | Microsoft Learn
maybe post the error message you’re getting.


I can see the provisioning plan in IQService logs, but it doesn’t show the PowerShell commands.

To clarify, I’m not getting any errors while provisioning, I only wish to check which PowerShell commands are being sent to prove to the team I’m working with that the commands I’m passing are the correct ones.

For that you might need to do log4net configuration Using Log4Net in PowerShell - Stack Overflow. That definitely works with ConnectorBefore/After scripts but not sure if it will work with default plan

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.