Powershell Befehle

Version 5.1 by Dimitri Rupp on 2026/06/11 11:12
Warning
For security reasons, the document is displayed in restricted mode as it is not the current version. There may be differences and errors due to this.

AD Policy anzeigen: 

Get-ADDefaultDomainPasswordPolicy 

Last Logon User: 

Get-ADUser „USERNAME“ -Properties LastLogonDate | FT -Property Name, LastLogonDate -A 

Last Logon PC/NB 

Get-ADComputer -Identity "name" -Properties LastLogonDate 

Last PW Change: 

Get-ADUser ‚username‘ -properties PasswordLastSet | Format-List 

Usercopy (Neueintritt) 

cd c:\users\adm.doer\desktop 

.\ und mit tab bis die copy Datei angezeigt wird - Enter 

ADSYNC 

AM ADSYNC-Server 172.19.129.32 die Powershell mit "run as admin" starten danach folgende Befehle eingeben: 

Connect-MsolService 

Usernameadm +PW 

Start-ADSyncSyncCycle -PolicyType Delta 

image-20210719134922-1.png

Installieren von Azure AD Modul 

Install-Module -Name MSOnline 

Connect-MsolService 

Alle User PW never expire: 

Search-ADAccount -PasswordNeverExpires -UsersOnly 

Line Manager zu Usernamen: 

  image-20210719134937-5.png

Handynummer zu Usernamen: 

  image-20210719134940-6.png

Set-CalendarProcessing -Identity "RaumPostfachName" -ForwardRequestsToDelegates $false -AllRequestInPolicy $false 

Win Key auslesen: 

wmic path softwarelicensingservice get OA3xOriginalProductKey 

Outlook Kalender Leserechte auf Postfach vergeben: 

Add-MailboxFolderPermission -Identity "user":\Calendar -User "user" -AccessRights Reviewer 

  image-20210719134948-7.png

Benutzername Office ändern 

Connect-MsolService 

Set-MsolUserPrincipalName -UserPrincipalName karl.weindorfer@spl-tele.com -NewUserPrincipalName karl.weindorfer@kelog.at 

1668089024720-820.png

Script Groups am DC starten 

.\Update-Groups.ps1 

Exchange Module 

image-20210719135134-1.png

image-20210719135138-2.png

Herausfinden, welche Postfächer ein User hat:

Get-Mailbox -ResultSize Unlimited | Get-MailboxPermission -User walter.kollmann@spl-tele.com | ft User,Identity,AccessRights

Lenovo SecureBoot aktivieren

#set
(gwmi -class Lenovo_SetBiosSetting –namespace root\wmi).SetBiosSetting("SecureBoot,Enable")
#save
(gwmi -class Lenovo_SaveBiosSettings -namespace root\wmi).SaveBiosSettings()

Auswertung der Berechtigungen auf Ordnerebene

$OrdnerPfad = "C:\BeispielOrdner"
$Elemente = Get-ChildItem -Path $OrdnerPfad -Recurse
$Berechtigungen = $Elemente | ForEach-Object {Get-Acl -Path $_.FullName}
$Berechtigungen | Export-Csv -Path "C:\Berechtigungen.csv" -NoTypeInformation

Verwandte Themen

Kuratiert — kann direkt im Editor ergänzt werden://

Failed to execute the [velocity] macro. Cause: [The execution of the [velocity] script macro is not allowed in [xwiki:IT-Wiki.Makros.Verwandte-Themen.WebHome]. Check the rights of its last author or the parameters if it's rendered from another script.]. Click on this message for details.


Status: Migriert — Team-Review ausstehend · Owner: (festlegen) · Letzter Review: 2026-06-11