Quantcast
Channel: The Official Scripting Guys Forum! forum
Viewing all articles
Browse latest Browse all 15028

Getting users that have a blank description attribute

$
0
0

Hello everyone, I'm trying to update the description attribute for all the user's on our domain. Using a do while loop I'm reading in each username and description from a spreadsheet. During the loop after I get the info about the user then I'm run a filter to get the user via their username. However, some user's already have a description. These were done manually in the past and I want to ignore them. I've tried to account for that in the line below however on the 5 accounts I'm testing against it's only altering the same user each time. It's ignoring the other 4 users. Only 1 of these user's already have a description and it's one of the 4 that's not being altered. Any ideas what I might be doing wrong?

Get-ADUser -Filter {(userPrincipalName -Like $userPrincipalName) -and (description -notlike "*")} | Set-ADUser -Description $description


Viewing all articles
Browse latest Browse all 15028

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>