Quantcast
Channel: PowerShell
Viewing all articles
Browse latest Browse all 15370

How to clear Manager attribute in specific OU using powershell?

$
0
0

I'mtrying to clear the Manager name under the "Organization" tab using PowerShell.

I would like to do this for the disabled OU.

Here is the script and error that I receive. Any help would be appreciated. Thank you

Import-Module ActiveDirectory


$OU ="OU=Users,OU=Disabled,DC=rp,DC=com"


-SearchBase$OU |


Set-ADUser-Manager $null –WhatIf



------------------------------------------------------------------------------------------

Windows PowerShell
Copyright (C) 2012 Microsoft Corporation. All rights reserved.

PS C:\Windows\system32 Import-Module ActiveDirectory
PS C:\Windows\system32
PS C:\Windows\system32
PS C:\Windows\system32
PS C:\Windows\system32 $OU ="OU=Users,OU=Disabled,DC=rp,DC=com"
PS C:\Windows\system32
PS C:\Windows\system32 -SearchBase $OU |

Set-ADUser -Manager $null –WhatIf

-SearchBase : The term '-SearchBase' is not recognized as the name...


Viewing all articles
Browse latest Browse all 15370

Trending Articles



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