Wichtige Konsolen

certlm.msc Zertifikate vom lokalen Computeraccount
certmgr.msc Zertifikate vom Benutzeraccount
compmgmt.msc Computerverwaltung
services.msc Dienste vom lokalen Computer
devmgmt.msc Gerätemanager
diskmgmt.msc Datenträgerverwaltung
eventvwr.msc Eventviewer
lusrmgr.msc Lokale Benutzerverwaltung
taskschd.msc Taskscheduler
virtmgmt.msc HyperV Management
wf.msc Windowsfirewall

FSMO Rollen

I`ll show you two quick ways to check FSMO roles on Windows 2003 server.

1. open command line and type :
netdom query fsmo
2. copy this code to notepad and save as fsmo.vbs script :
Set objRootDSE = GetObject(”LDAP://rootDSE”)
Set objSchema = GetObject _
(”LDAP://” & objRootDSE.Get(”schemaNamingContext”))
strSchemaMaster = objSchema.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strSchemaMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Forest-wide Schema Master FSMO: ” & objComputer.Name

Set objNtds = Nothing
Set objComputer = Nothing

Set objPartitions = GetObject(”LDAP://CN=Partitions,” & _
strDomainNamingMaster = objPartitions.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strDomainNamingMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Forest-wide Domain Naming Master FSMO: ” & objComputer.Name

Set objDomain = GetObject _
(”LDAP://” & objRootDSE.Get(”defaultNamingContext”))
strPdcEmulator = objDomain.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strPdcEmulator)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s PDC Emulator FSMO: ” & objComputer.Name

Set objRidManager = GetObject(”LDAP://CN=RID Manager$,CN=System,” & _
strRidMaster = objRidManager.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strRidMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s RID Master FSMO: ” & objComputer.Name

Set objInfrastructure = GetObject(”LDAP://CN=Infrastructure,” & _
strInfrastructureMaster = objInfrastructure.Get(”fSMORoleOwner”)
Set objNtds = GetObject(”LDAP://” & strInfrastructureMaster)
Set objComputer = GetObject(objNtds.Parent)
WScript.Echo “Domain’s Infrastructure Master FSMO: ” & objComputer.Name

Then open command line and type: cscript fsmo.vbs

Exchange Logfiles

Remove Exchange Log Files:

Remove old Exchange Log Files Artikel

Befehl inkl. Internet Information Service Folder für 14 Tage:

gci ‚C:\Program Files\Microsoft\Exchange Server\V15\Logging‘,’C:\inetpub\logs‘ -Directory | gci -Include ‚*.log‘,’*.blg‘ -Recurse | ? LastWriteTime -lt (Get-Date).AddDays(-14) | Remove-Item

Enable Circular Logging:

Set-MailboxDatabase {Database-Name} -CircularLoggingEnabled $True
net stop "Microsoft Exchange Information Store"
net start "Microsoft Exchange Information Store"

PowerShell Befehle

Verbindung zu Office365:
Install-Module -Name AzureAD
Install-Module MSOnline
$credential = Get-Credential
Connect-MsolService -Credential $credential
Connect-AzureAD -Credential $credential
Office 365 AD Sync Befehle:
Import-Module ADSync
Start-ADSyncSyncCycle -PolicyType Delta
Start-ADSyncSyncCycle -PolicyType Initial
MAC Adresse per Powershell ansehen:
Get-NetAdapter | select name, macaddress | sort macaddress
Send Email per Powershell Command:
Send-MailMessage -SmtpServer IPorMailServerName -To Emailto@xyz.ch -From EmailFrom@xyz.ch -Subject „It`s me Ronald“ -Body „Send a Test Mail“

Windows Zeitserver konfigurieren

How to set Windows Time Service on Windows Server

w32tm /config /manualpeerlist:%DCNAME%.%DOMAIN%.local,ptbtime1.ptb.de,pool.ntp.org,time.windows.com /syncfromflags:manual /reliable:yes /update

syncfromflags:manual -> heisst: manuelle Peerliste verwenden
reliable:yes -> heisst: yes=er selber dient als Zeitsource Server no=kein Zeitsource Server