I have developed a PowerShell script which exports users mailboxes to a
remote server. The basic script I can run in the AD driver, like so:
New-MailboxExportRequest -BatchName "test" -Mailbox "user" -FilePath

Now my script must do alot more than just that, and in that script, I
must reference some variables, and if I attempt to do so, when running
the script from the AD driver, I get this error:

A variable that cannot be referenced in restricted language mode or a
Data section is being referenced.

So I guess the PS session that the driver has, is in restricted mode.

So maybe I should place the PS script on the remote loader server, and
call it from the driver policy somehow. But I don't know how and can't
really find anything anywhere on it. Or, maybe I can turn off this
restricted language mode somehow?

What would be the best approach, and how would I go about doing it?

Thanks in advance,


jacmarpet's Profile: https://forums.netiq.com/member.php?userid=415
View this thread: https://forums.netiq.com/showthread.php?t=51458