Hi guys, another day another query,
I have created the script below to validate some details of some user accounts. The script runs fine unless I output to a file:
ForEach ($user in $users) {get-qaduser "$user" -sizelimit 0 -IncludedProperties altRecipient | select name,altRecipient,accountexpires,pass*,accountisdisabled,lastlog*,canonicalname } | export-csv -path d:\Leaver-Validation.csv
If I try to ouput the script to a file PowerShell errors with the following:
An empty pipe element is not permitted.
At line:1 char:186
+ foreach ($user in $users) {get-qaduser "$user" -sizelimit 0 -IncludedProperties altRecipient | select name,altRecipie
nt,accountexpires,pass*,accountisdisabled,lastlog*,canonicalname } | <<<< export-csv -path d:\Leaver-Validation.csv
I'm lost on why this happening, Does anyone have any Ideas?
Thanks
Lee