Let's say we have the following code
Get-ADUser -Filter {Enabled -eq $false} -properties * | sort Surname| FT GivenName, Surname, description
It produces:
GivenName Surname description
--------- --------- ------- -----------
Tom Abbott AccountingSystems
Tim Baker AccountingSystems
Tyler Cabot AccountingSystems
I need to put a space in between 'Accounting' and 'System'
I thought this would work:
Get-ADUser -Filter {Enabled -eq $false} -properties *
% {
$Description = $.replace("Accounting","Accounting ")
Set-ADUser = -Description $Description
}
But... it does not.
$_.Description.replace("Accounting","Accounting ")Enabled -eq $falsedoesn't actually work as intended. Does it?