powershellactive-directoryskypelyncoffice-communicator

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?


Solution

  • 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).