User Tools

Site Tools


powershell

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
Next revision Both sides next revision
powershell [2021/10/13 12:29]
val
powershell [2023/02/24 18:24]
val
Line 14: Line 14:
  
 ===== Добавление в домен пользователей ===== ===== Добавление в домен пользователей =====
 +
 +  * [[https://​learn.microsoft.com/​en-us/​powershell/​module/​activedirectory/​new-aduser?​view=windowsserver2022-ps|New-ADUser]]
 +  * [[https://​winitpro.ru/​index.php/​2018/​03/​02/​new-aduser-sozdaem-polzovatelej-v-domene/​|New-ADUser:​ создать учетную запись пользователя с помощью PowerShell]]
  
 <​code>​ <​code>​
 New-ADUser -Name "Ivan I. Ivanov"​ -DisplayName "Ivan I. Ivanov"​ -GivenName "​Ivan"​ -Initials "​I"​ -Surname "​Ivanov"​ ` New-ADUser -Name "Ivan I. Ivanov"​ -DisplayName "Ivan I. Ivanov"​ -GivenName "​Ivan"​ -Initials "​I"​ -Surname "​Ivanov"​ `
--SamAccountName "​user1" ​-UserPrincipalName "​user1@corpX.un"​ -Path "​CN=Users,​DC=corpX,​DC=un"​ ` +-SamAccountName "​user1"​ -AccountPassword(ConvertTo-SecureString -AsPlainText '​Pa$$w0rd1'​ -Force) `
--AccountPassword(ConvertTo-SecureString -AsPlainText '​Pa$$w0rd1'​ -Force) `+
 -Enabled $true -ChangePasswordAtLogon $false -Enabled $true -ChangePasswordAtLogon $false
  
 New-ADUser -Name "Petr P. Petrov"​ -DisplayName "Petr P. Petrov"​ -GivenName "​Petr"​ -Initials "​P"​ -Surname "​Petrov"​ ` New-ADUser -Name "Petr P. Petrov"​ -DisplayName "Petr P. Petrov"​ -GivenName "​Petr"​ -Initials "​P"​ -Surname "​Petrov"​ `
--SamAccountName "​user2"​ -UserPrincipalName "​user2@corpX.un" ​-Path "CN=Users,DC=corpX,DC=un" ` +-SamAccountName "​user2"​ -AccountPassword(ConvertTo-SecureString -AsPlainText '​Pa$$w0rd2'​ -Force) ` 
--AccountPassword(ConvertTo-SecureString -AsPlainText 'Pa$$w0rd2' -Force) `+-Enabled $true -ChangePasswordAtLogon $false 
 +</​code>​ 
 +  * [[Материалы по Windows#​Установка русского Language pack в Windows Server 2016]] 
 +  * [[https://​social.technet.microsoft.com/​Forums/​office/​en-US/​771d0054-2838-4d22-865f-7a7634613b70/​want-to-create-bulk-of-users-with-special-character-etc?​forum=winserverpowershell|Want to Create Bulk of users with special character(Üö etc)]] 
 +<​code>​ 
 +!!! Разобратьсяпочему не работает 
 + 
 +New-ADUser -Name "​Сидор Сидорович Сидоров"​ -DisplayName "​Сидор Сидорович Сидоров"​ -GivenName "​Сидор"​ -Initials "​Сидорович"​ -Surname "​Сидоров" ` 
 +-SamAccountName "​user3" ​-AccountPassword(ConvertTo-SecureString -AsPlainText 'Pa$$w0rd3' -Force) `
 -Enabled $true -ChangePasswordAtLogon $false -Enabled $true -ChangePasswordAtLogon $false
 </​code>​ </​code>​
Line 32: Line 42:
  
 <​code>​ <​code>​
-Get-ChildItem HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall;​ powershell -Command Get-ChildItem HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall+powershell -Command ​Get-ChildItem HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall; ​ 
 + 
 +powershell -Command Get-ChildItem HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall 
 + 
 +  или, с форматированием 
 + 
 +powershell -command "​Get-ItemProperty HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName,​ DisplayVersion,​ Publisher, EstimatedSize,​ InstallDate | Format-Table -AutoSize"​  
 + 
 +powershell -command "​Get-ItemProperty HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Select-Object DisplayName,​ DisplayVersion,​ Publisher, EstimatedSize,​ InstallDate | Format-Table -AutoSize"​ 
 + 
 +  или еще 2 варианта:​) 
 +   
 +powershell -command "​Get-ItemProperty HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Get-ItemProperty | Where-Object '​DisplayName'​ | Sort-Object -Property DisplayName | Select-Object -Property DisplayName | Format-Table -AutoSize -HideTableHeaders"​ 
 +powershell -command "​Get-ItemProperty HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Get-ItemProperty | Where-Object '​DisplayName'​ | Sort-Object -Property DisplayName | Select-Object -Property DisplayName | Format-Table -AutoSize -HideTableHeaders"​ 
 + 
 +powershell -command "​Get-ItemProperty HKLM:​\Software\Microsoft\Windows\CurrentVersion\Uninstall\* | Get-ItemProperty | Where-Object '​DisplayName'​ | Sort-Object -Property DisplayName | Select-Object DisplayName,​ DisplayVersion,​ Publisher, EstimatedSize,​ InstallDate | Format-Table -AutoSize"​ 
 +powershell -command "​Get-ItemProperty HKLM:​\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\* | Get-ItemProperty | Where-Object '​DisplayName'​ | Sort-Object -Property DisplayName | Select-Object DisplayName,​ DisplayVersion,​ Publisher, EstimatedSize,​ InstallDate | Format-Table -AutoSize"​
 </​code>​ </​code>​
 +
powershell.txt · Last modified: 2023/03/17 20:42 by val