Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

add logged in user to local administrators group powershell site:www.reddit.com

$LocalhostSession= New-PSSession -ComputerName localhost -Credential $mycreds 
$Arguments = @($username)
$sb= {Param ([string]$username); $de = [ADSI]"WinNT://$env:computername/administrators,group"; $de.psbase.Invoke("Add",([ADSI]"WinNT://domain.net/$username").path)}
Invoke-Command -ComputerName $env:COMPUTERNAME -Session $LocalhostSession  -ArgumentList $Arguments -ScriptBlock $sb
Comment

PREVIOUS NEXT
Code Example
Shell :: i wrongly deleted code , can i retrieve through git command 
Shell :: apt-get install ping?trackid=sp-006 
Shell :: see active apcahe conf file 
Shell :: bash cat file and rewrite it same line 
Shell :: bash mail subject variable 
Shell :: run level to boot in gui centos 
Shell :: rolyn is missing after retrieve from source control 
Php :: install php intl extension xampp windows 
Php :: php console log array 
Php :: php hide errors 
Php :: list all files in directory php 
Php :: wordpress base theme child url 
Php :: laravel Str::random 
Php :: laravel migration add column to existing table 
Php :: php redirect 
Php :: auto generate password in php 
Php :: access to this resource on the server is denied laravel 
Php :: php object to array 
Php :: php preg_match email validation code 
Php :: php remove extension from url 
Php :: get id user login laravel 
Php :: php foreach reverse 
Php :: macos install php 7.4 
Php :: php loop through json 
Php :: convert one time zone datetime value to another using php 
Php :: php sum array key 
Php :: mac use php@7.4 
Php :: Sorry, This File Type Is Not Permitted for Security Reasons 
Php :: php get ip to location 
Php :: laravel format number blade 
ADD CONTENT
Topic
Content
Source link
Name
2+2 =