FN-GM Posted February 23, 2021 Posted February 23, 2021 Hello, I was wondering if anyone had a script that would add and remove users from a specified AD group if the mobile number is populated please? I am trying to tidy our Office 365 signatures. Currently we populate them with phone numbers. If someone doesn't have a mobile phone it displays blank on the signature. Ideally I would like to remove any reference at all. Using the group I can have 2 signature templates. Thanks
chaplic Posted February 23, 2021 Posted February 23, 2021 Groups would be MobleUsers and NonMObileUsers... $mobileusers=get-aduser -filter {mobilephone -like "*"} add-adgroupmember "Mobileusers" -members $mobileusers $nonmobileusers=get-aduser -filter {mobilephone -notlike "*"} add-adgroupmember "NonMobileusers" -members $nonmobileusers
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now