r/PowerShell • • Jul 23 '19

Use PowerShell delete a user profile (step-by-step guide)

https://adamtheautomator.com/powershell-delete-user-profile/?utm_source=reddit&utm_medium=social&utm_campaign=newblogpostnotifications
120 Upvotes

59 comments sorted by

View all comments

20

u/[deleted] Jul 24 '19

[removed] — view removed comment

1

u/jatorres Jul 24 '19

Really? I thought PowerShell was the end all, be all of Windows automation? Any guides / best practices for a GPO that would do this?

19

u/[deleted] Jul 24 '19 edited Jul 24 '19

[removed] — view removed comment

0

u/[deleted] Jul 24 '19

[deleted]

2

u/[deleted] Jul 24 '19

[removed] — view removed comment

0

u/Aalkfk Jul 24 '19 edited Jul 24 '19

Wouldn’t DSC be the better approach for the automation of „PS-Scripts“?🤔 I think it Is a good mix between PS and GP.

3

u/halbaradkenafin Jul 24 '19

Not really. DSC is all about configuration management, it's not a task runner (though it can do that). You want to use DSC to say "my server should be configured in this way, make it so (and possibly keep it that way)" and it goes off and does its thing.

2

u/Aalkfk Jul 24 '19

Sure, but isn't it also a configuration that certain profiles should be deleted After X unused days? Of course, it is not like task planner and also involves more effort. But if you want to go towards the shell, it makes more sense than the GP (at least as soon as you know if and how the new versions are backwards compatible).

1

u/[deleted] Jul 24 '19

[removed] — view removed comment

2

u/halbaradkenafin Jul 24 '19

The problem I've got with GPO is that it's not very visible. If I want to find out how a node is configured I have to run RSOP or other tools, and tracking down where things are configured is a pain. DSC has the advantage that everything is in code, so it's all in source control, I can control how I roll out changes and updates a lot easier using a pipeline to a pull server, I can use Pester to test it in an easier way than GPO.

GPO certainly still has a place but I'd be moving most of my general machine settings over to DSC, your user specific settings aren't as manageable by DSC so they are best off staying configured by GPO.

→ More replies (0)

1

u/Aalkfk Jul 24 '19

I'm with you on this one. GP is the easiest way (If there are no problems in combination with Windows 10). Just wanted to show that there is a another option. :-)

→ More replies (0)