New to PS scripting-help with add user to AD group

You can only go as fast as the human element allows.

Of the two items in there that require human interaction, you can remove one.

At least in the case where the user is already part of thegroup, once the name is entered and the script begins to run, then it takes 15-17 seconds on average. I understand the piece that requires human input needs to be done first. Does that help?

It takes 7 seconds on my machine adding a user to a group they are not a member of, with removing the -confirm switch.

Something wrong in your environment.

To make your measuremnts valid you should move the start of the measurement down after the Reead-Host. The speed also depends on some other conditions. … the size of the targeted group, if you run the script on a domain controller or remote …