Quantcast
Channel: PowerShell.org » All Posts
Viewing all articles
Browse latest Browse all 13067

Need Help with Advanced Functions

$
0
0

I have a script that i wrote, but i would like to utilize advanced functions and i have never created one. The script that I have basically reads a userlist.txt file and a computerlist.txt file and it creates an AD group named after the computer with a “-adm” that it reads from the computerlist.txt file. For instance, “%computername%-adm”. Then it takes the users in the userlist.txt file and puts them in the “%computername%-adm” AD group. Then, the script adds the “%computername%-adm” group to the computer’s local admin group.

I would like to be able to have the Tech Support team members where I work run the script with parameters rather than being asked several questions during the processing of the script. For instance, it would be nice to have a Tech Support member run the following command:

Add-LocalAdminUser.ps1 -computer “.\ComputerList.txt” -user “.\UserList.txt” -adgrouptype “global”

If someone can help me understand how I may be able to go about doing this, I would greatly appreciate it.

Thanks alot everyone.


Viewing all articles
Browse latest Browse all 13067

Trending Articles