In our scenario we need to create a homefolder for the user and when
entitled a mailbox. For this situation, our solution is combining
multiple powershell command's in one PSExecute dest-attr.

We used this before on a Windows 2008 R2 server (Remote Loader IDM
4.0.2) in combination with Exchange 2010, now a few years later we want
to use the same solution on Windows 2012 R2 server (Remote Loader IDM
4.5.3) in combination with Exchange 2013.

And there comes the issue, we used an if statement to make sure that the
command continuous on an error, so if the homefolder fails we will still
have the mailbox and visa versa. The only point is that when we use the
"{}" around the commando's we get the following error:


[02/23/16 12:06:35.169]:NIVO-AD ST:Remote Interface Driver: Sending...
[02/23/16 12:06:35.169]:NIVO-AD ST:
<nds dtdversion="4.0" ndsversion="8.x">
<product edition="Advanced" version="">DirXML</product>
<contact>NetIQ Corporation</contact>
<modify cached-time="20160223110634.883Z" class-name="user" event-id="idv#20160223110634#1#1:725acbbe-5424-4f56-2c99-becb5a722454" qualified-src-dn="O=vault\OU=identities\OU=employees\CN=11568523 4185188" src-dn="\TREE\vault\ident
ities\employees\115685234185188" src-entry-id="225194" timestamp="1456225594#2">
<association state="associated">b1536ca9198d9446a1c6518bff9863d 7</association>
<modify-attr attr-name="PSExecute">
<value type="string">if ($true) {Enable-Mailbox -Identity corp\username -Alias useralias}</value>
[02/23/16 12:06:35.170]:AD ST:Remote Interface Driver: Document sent.
[02/23/16 12:06:35.231]:AD :Remote Interface Driver: Received.
[02/23/16 12:06:35.231]:AD :
<nds dtdversion="1.1" ndsversion="8.7">
<product asn1id="" build="20150311_120000" instance="\TREE\services\driverset\Active Directory" version="">AD</product>
<contact>NetIQ Corporation</contact>
<status event-id="idv#20160223110634#1#1:725acbbe-5424-4f56-2c99-becb5a722454" level="error" type="powershell">Error completing powershell command. ERROR: At line:1 char:86
+ ... lias PAlthuis} | Out-String
+ ~
An empty pipe element is not allowed.

<status event-id="idv#20160223110634#1#1:725acbbe-5424-4f56-2c99-becb5a722454" level="success"/>


At first we thought that it was about the $false or $true we use, but
when we execute the command without the "{}" is completes successfully.
The only problem is that we can't send multiple powershell commands if
we don't use them.

My question is, did anyone of you occurred the same issue or have any
advice about other possibilities?

nduijvelshoff's Profile:
View this thread: