Quantcast
Channel: PowerShell.com – PowerShell Scripts, Tips, Forums, and Resources
Viewing all articles
Browse latest Browse all 6937

Script to Trim ending spaces in active directory users attributes.

$
0
0

Trying to get a script to work to delete the spaces in some of our users extentionAttribute6 entries.

 

Get-aduser -filter [extensionAttribute6 -like "*"} | Foreach {Set-aduser -Identity $_.extensionAttribute6 $_.extensionattribute6.TrimEnd()}

 

I get a "You cannot call a method on a null-valued expression" Error.

 

Any help would be appreciated!


Viewing all articles
Browse latest Browse all 6937

Trending Articles