简体   繁体   中英

Modify msrtcsip-userenabled Active Directory Attribute

I need to modify the msrtcsip-userenabled attribute from True to False for a list of users. So far here's what I have:

To gather the list of users:

Get-Aduser -Filter * -Properties homeDirectory | Where-Object {$_.homeDirectory -Like "\\SERVERNAME*"} | Select-Object SamAccountName

I need to modify each of the users, I know that I'll need to use set-aduser . Either importing the results into the next part of the script or exporting to CSV would work.

How can I do that?

you can use Set-Aduser like

Get-ADUser -Filter * -Properties homeDirectory | Where-Object {$_.homeDirectory -Like "\\SERVERNAME*"} | Set-ADUser -Clear 'msrtcsip-userenabled'

to clear the value.

Or you could overwrite the value to something new, like this:

Get-ADUser -Filter * -Properties homeDirectory | Where-Object {$_.homeDirectory -Like "\\SERVERNAME*"} | Set-ADUser -Replace @{'msrtcsip-userenabled' = 'new value'}

no need to export to a CSV file (unless you need to).

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM