Firstly Søren Granfeldt thank you for writing and releasing this MA! I'm using it for Account Expiration dates already!! My issue is when trying to connect to Exchange Online (O365) to manage mailboxes.
I'm using the Granfeldt PowerShell MA to access data in Office 365 but not just the dirsync (is the user licensed) but also properties on the Exchange Online.
I can connect to Exchange Online (O365) when running the script as the service account (FIMService). It connects using stored credentials to Exchange Online using Remote PowerShell and Importing the session with -AllowClobber. However I get an error on the Import-PSSession line saying that $Session is undefined / Null when the MA Runs it.
I have a couple of questions.
1) If I edit the import.ps1 script (Import Script) do I need to refresh the PowerShell MA Schema for it to pick up the changes or does it load and run this on the fly?
2) Has any one ran an Import-PSSession with the Granfeldt PowerShell and gotten a script Error: Script error in line 24: [Cannot validate argument on parameter 'Session'. The argument is null. Supply a non-null argument and try the command again.]
- (At {REMOVED}
+ Import-PSSession -Session $mySession -AllowClobber -WarningAction SilentlyCo ...
The error is under the $mySession variable, it should connect just fine, I've gone so far as hard coding the password into the script.
3) Is there any way to make the import script "Run as Admin / Elevated" ?
Thanks in advance!!!!
Jonathan Manley