question

Punkasur-0941 avatar image
0 Votes"
Punkasur-0941 asked PadmanabhanVaidyanathan-6987 answered

Powershell script to delete the roaming profile path entry in ADUC for several users

Hi,

We have an issue with using FSLogix and the existing AD setup where roaming profile path is set in the ADUC under the Profile Tab. If you have profile set on AD and you want to use FSLogix to manage roaming profile, this will not work as its obviously going to clash which GPO/AD setting to honor when you login. We are moving away from roaming profiles, so the only way for this to work is to set FSLogix as intended via standard GPO settings to manage roaming profile, and then delete the Roaming Profile path entry in ADUC.

Now i need to delete this for around 600 users. They are all in a security group. So i wonder if there if you can help with a powershell script to mass delete the roaming profile path entry with the security group as the targer object? Any help would be appreciated.

Thanks
Punkasur

windows-server-powershellwindows-active-directorywindows-server-2012
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

AndreasBaumgarten avatar image
1 Vote"
AndreasBaumgarten answered AndreasBaumgarten edited

Hi @Punkasur-0941 ,

maybe this helps - Not tested by myself / use on your own risk!:

 #Try one user first
 Get-ADUser -Identity "<testUser-samAccountName>" -Properties ProfilePath | Set-ADUser -Clear ProfilePath
    
 # Not tested by myself - use on your own risk!
 Get-ADGroupMember -Identity "<YourGroupContainingUsers-Name>" | Where-Object {$_.objectClass -eq "user"} | Set-ADUser -Clear ProfilePath


(If the reply was helpful please don't forget to upvote and/or accept as answer, thank you)

Regards
Andreas Baumgarten



· 7
5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.

Hi Andreas,

The first example works for a test user i created, Thanks. I will create a test security group and see your second example works



0 Votes 0 ·

And the second one works too! That's great i've got something to work on.

0 Votes 0 ·

Hi @Punkasur-0941 ,

iIf you found the answer helpful, it would be great if you please mark it "Accept as answer". This will help others to find answers in Q&A


Regards
Andreas Baumgarten

0 Votes 0 ·
Show more comments
PadmanabhanVaidyanathan-6987 avatar image
0 Votes"
PadmanabhanVaidyanathan-6987 answered

Hi Andreas,

I just wanted to say thank you for the script, worked like a charm.

Regards,
Paul.

5 |1600 characters needed characters left characters exceeded

Up to 10 attachments (including images) can be used with a maximum of 3.0 MiB each and 30.0 MiB total.