|
Hello, can you please help me, how we can pass through Credential in the script.
$Files= Import-Csv C:\Users\###\Desktop\SQLSERVER S.txt Foreach ($File in $Files){ .\Set-ADAccount asLocalAdminist rator.ps1 -Computer '$File' -Trustee ###\### } any suggestions on the error ### are just where domain and username was
How would you read in a file of multiple server names, and then make the trustee for each server be admin_servername_user?
I need to modify this script to add a list of users to local Administrators. Like so: .\Set-ADAccountasLocalAdminist rator.ps1 -Computer Server1 -trustee c:\UserList.txt How would I replace $Trustee with a text file of usernames, or add a variable to substitute -Trustee with -UserList c:\Users.txt ? Thanks for educating me!
Hello Jaap, Getting below error. WARNING: The following exception occurred while retrieving member "add": "The network path was not found. I ran below command only i see different is .ps1 two times on your script. .\Set-ADAccountasLocalAdminist rator.ps1 -InputFile C:\server\serve r.txt -Trustee phon\sql
You need to enable file and print sharing. I did it via a GPO. Computer Configuration > Administrative Templates > Network > Network Connections > Windows Firewall > Domain Profile.
I am trying to simplify the script if possible but hitting a road block. What i am trying to do is basically have the file on a USB pen drive. Plug into a Win10 system, run file and have it add a list of predetermined (editable) employee numbers (that are associated with a global domain name) to the local machine as admins. this will give the employees ability to log on, let the machine create the local profile associated with their global accounts. Thougths or insight is apprciated.
It is trying to add the group but after sometime it throws below error, Please help WARNING: Exception calling "add" with "1" argument(s): "A member could not be added to or removed from the local group because the member does not exist.
Thank you for the great help Mr. Brasser could you please help to add users on windows performance log users?
Please ignore this one...I can modify AetAccountAsRDPusers.ps1 for performance log users. Thanks!
.\Set-ADAccountasLocalAdminist rator.ps1 : Parameter set cannot be resolved using the specified named parameters. + CategoryInfo : InvalidArgument : (:) [Set-ADAccounta sLocalAdministr ator.ps1], ParentContainsE rrorRecordExcep tion + FullyQualifiedE rrorId : AmbiguousParame terSet,Set-ADAc countasLocalAdm inistrator.ps1 What i'm i doing wrong. Similar to Bill77's issue
Hi Step2skimo, Can you show which parameters you are using to execute the command? Based on the error message I think you might be using a wrong set of parameters. Regards, Jaap Brasser
Hello Balu, you are receiving that error because you are trying to run the selection without the specified parameters. You need to specify both parameters, Computer and Trustee, or Inputfile and Trustee. If you copy and paste the PS1 data and just run the selection you will get the error you are receiving, since the function isn't defined and there are parameters missing. Here's a working example below, Inputfile being a csv of all servers I want to add the trustee account to. .\Set-ADAccountasLocalAdminist rator.ps1 -InputFile C:\Users\darive ra\Documents\al lservers.csv -Trustee Sp_Task_Schedul er
hello Jaap, many thanks for your response . I was able to successfully use this now. This worked for me.
Hi Jaap, I am looking for remove profile script which delete all profile except users who belongs to administrators of that server. I have one script but does not exclude administrators group from remote server. Could you please help me in this case? Thank You.