TGViewer
Системный администратор Системный администратор @i_linux · 1.95K subscribers
Post #1149 514
Подборка скриптов PowerShell для работы с Azure, Active Directory, SCCM, SCSM, Exchange ...

Пример скрипта

function Get-LocalUser {

<#
.SYNOPSIS
This script can be list all of local user account.

.DESCRIPTION
This script can be list all of local user account.
The function is using WMI to connect to the remote machine

.PARAMETER ComputerName
Specifies the computers on which the command . The default is the local computer.

.PARAMETER Credential
A description of the Credential parameter.


.EXAMPLE
Get-LocalUser

This example shows how to list all of local users on local computer.

.NOTES
Francois-Xavier Cat
lazywinadmin.com
@lazywinadmin
.LINK
https://github.com/lazywinadmin/PowerShell
#>

PARAM
(
[Alias('cn')]
[String[]]$ComputerName = $Env:COMPUTERNAME,

[String]$AccountName,

[System.Management.Automation.PsCredential]$Credential
)

$Splatting = @{
Class = "Win32_UserAccount"
Namespace = "root\cimv2"
Filter = "LocalAccount='$True'"
}

#Credentials
If ($PSBoundParameters['Credential']) { $Splatting.Credential = $Credential }

Foreach ($Computer in $ComputerName) {
TRY {
Write-Verbose -Message "[PROCESS] ComputerName: $Computer"
Get-WmiObject @Splatting -ComputerName $Computer | Select-Object -Property Name, FullName, Caption, Disabled, Status, Lockout, PasswordChangeable, PasswordExpires, PasswordRequired, SID, SIDType, AccountType, Domain, Description
}
CATCH {
Write-Warning -Message "[PROCESS] Issue connecting to $Computer"
}
}
}


https://github.com/lazywinadmin/PowerShell


👉@i_linux
  • 👍 1
  • 🔥 1
More from @i_linux
  1. Sep 11, 2026Горячие клавиши VirtualBox Основные ярлыки в VirtualBox F1: Отображает справку. Ctrl + D М…
  2. Sep 8, 2026Увеличение времени сессии SSH Бывает, что выполнение удаленно запущенной команды может зат…
  3. Sep 1, 2026Регулярные выражение для поиска IP адресов Ниже представлены регулярные выражения, которые…
  4. Aug 26, 2026Старое доброе видео, кто помнит? Веселенький денек у сисадмина... Системный администратор…
  5. Aug 17, 2026ChopChopGo Это инструмент для просмотра журналов Linux наподобие chainsaw и Hayabusa, отли…
  6. Aug 8, 2026До / После 📲 Мы в MAX 👉@i_linux
Threads Profile ViewerView any public Threads profile without an account.Open ThreadLook →Writing with AI? Make it sound human.Metric37 rewrites AI drafts so they read naturally. Free AI detector, 1,500 words free.Try Metric37 →