- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 815
$user = [ADSI]"WinNT://domain/username,user"
$AdminGroup = [ADSI]"WinNT://$host/Пользователи удаленного рабочего стола,group";
$AdminGroup.Add($user.Path)
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 830
$ObjUser = [ADSI]"WinNT://$computer/$user"
$ObjUser.IsAccountLocked = $false
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 876
PS C:\> $def = @"
public class ClientCertWebClient : System.Net.WebClient
{
System.Net.HttpWebRequest request = null;
System.Security.Cryptography.X509Certificates.X509CertificateCollection certificates = null;
protected override System.Net.WebRequest GetWebRequest(System.Uri address)
{
request = (System.Net.HttpWebRequest)base.GetWebRequest(address);
if (certificates != null)
{
request.ClientCertificates.AddRange(certificates);
}
return request;
}
public void AddCerts(System.Security.Cryptography.X509Certificates.X509Certificate[] certs)
{
if (certificates == null)
{
certificates = new System.Security.Cryptography.X509Certificates.X509CertificateCollection();
}
if (request != null)
{
request.ClientCertificates.AddRange(certs);
}
certificates.AddRange(certs);
}
}
"@
PS C:\> Add-Type -TypeDefinition $def
S C:\> $wc = New-Object ClientCertWebClient
PS C:\> $certs = dir cert:\CurrentUser\My
PS C:\> $wc.AddCerts($certs)
PS C:\> $wc.DownloadString("http://stackoverflow.com")
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 995
-
Launch PowerShell and dot source function from the
Out-Minidump.ps1
(note first dot):
. c:\path\to\Out-Minidump.ps1
- Now you can actually create dump of the process using this syntax:
Get-Process 'notepad.exe' | Out-Minidump -DumpFilePath C:\temp
- To get help, run this command:
Get-Help Out-Minidump -Full
- Details
- Written by: po3dno
- Category: Power Shell
- Hits: 840
[void][reflection.assembly]::LoadWithPartialName("Microsoft.UpdateServices.Administration")
$wsus = [Microsoft.UpdateServices.Administration.AdminProxy]::getUpdateServer("localhost",$False)
$groupall = $wsus.GetComputerTargetGroups()
$pcall = $groupall | %{$_.GetComputerTargets()}