• Home
  • Linux
  • Docker
  • Windows
    • PS
    • C#
    • Exchange Server
  • Other
    • Perl
    • IPV6
    • MacOS
  • DB
    • MSSQL
    • MariaDB
    • PG

Home

Сброс пользователей 1С

Details
Written by: po3dno
Category: MSSQL
Created: 06 June 2016
Hits: 912

use [DBNAME]

EXEC sp_rename 'v8users', 'v8users_old'

GO

UPDATE Params

SET FileName = 'users.usr_old'

WHERE FileName = 'users.usr'

GO

 

use [DBNAME]

DROP TABLE v8users

GO

EXEC sp_rename 'v8users_old', 'v8users'

GO

UPDATE Params

SET FileName = 'users.usr'

WHERE FileName = 'users.usr_old'

GO

DHCP Policy

Details
Written by: po3dno
Category: Power Shell
Created: 24 May 2016
Hits: 1058

# получить список mac

[System.Collections.ArrayList]$d = (Get-DhcpServerv4Policy -ScopeId 172.16.36.0 -name "Mac allow").MacAddress

 

# удалить MAC

$d.Remove("24-e3-14-82-6c-86")

 

# добавить EQ

$res = ($d | ?{$_ -ne "EQ"} | sort) -join ",EQ," -replace '^(.*)','EQ,$1' -split ","

 

# сохранить политику

Set-DhcpServerv4Policy -ScopeId 172.16.36.0 -Name "Mac allow" -MacAddress $res

Add user to local group

Details
Written by: po3dno
Category: Power Shell
Created: 28 April 2016
Hits: 1018

$user = [ADSI]"WinNT://domain/username,user"

$AdminGroup = [ADSI]"WinNT://$host/Пользователи удаленного рабочего стола,group";

$AdminGroup.Add($user.Path)

Unlock local account

Details
Written by: po3dno
Category: Power Shell
Created: 28 April 2016
Hits: 1006

$ObjUser = [ADSI]"WinNT://$computer/$user" 
$ObjUser.IsAccountLocked = $false

Powershell SSL Certificate

Details
Written by: po3dno
Category: Power Shell
Created: 26 April 2016
Hits: 1063
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")
  1. Exchange 2013/2016 обновление
  2. процессы и их блокировки в SQL
  3. dump process in Windows Server 2008
  4. Wsus target by network

Subcategories

Power Shell Article Count:  53

C# Article Count:  10

Perl Article Count:  1

Exchange Server Article Count:  15

Other Article Count:  24

MSSQL Article Count:  17

Windows Article Count:  25

MariaDB Article Count:  3

Linux Article Count:  8

Docker Article Count:  2

pg Article Count:  1

Page 20 of 32

  • 15
  • 16
  • 17
  • 18
  • 19
  • 20
  • 21
  • 22
  • 23
  • 24

Login Form

  • Forgot your password?
  • Forgot your username?

Statistics

  • Users 2
  • Articles 175
  • Articles View Hits 154332