Looking for Powershell script that allows me to delete profile path for every AD user in OU

Looking for a powershell script that will allow me delete the profile path in profile tab for every AD user in a particular OU

Is it a case of using

Set-ADUser -Clear ProfilePath within OU
LVL 1
Indie101Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

oBdACommented:
In test mode; remove the -WhatIf at the end to run it for real:
Get-ADUser -Filter "profilePath -like '*'" -SearchBase "OU=SomeUserOU,OU=SomeParentOU,DC=SomeDomain,DC=tld" | Set-ADUser -Clear profilePath -WhatIf

Open in new window

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
Indie101Author Commented:
Thanks i get what if: Performing the operation "set" on target

If i add cn=testuser at start that will just take profile off that one yeah?
oBdACommented:
i get what if: Performing the operation "set" on target
That's the test mode as indicated above.
For testing with a single account, you can adjust the filter to use SamAccountName, or just go for the user's Identity
Still in test mode, will not change anything in AD until the -WhatIf is removed:
Get-ADUser -Identity testuser | Set-ADUser -Clear profilePath -WhatIf 

Open in new window

Indie101Author Commented:
Super thanks very much :)
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Powershell

From novice to tech pro — start learning today.