This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Discover all VMs in a specific vSphere Cluster | |
$AllVMs = Get-Cluster PROD | Get-VM | ? { $_.Name -notlike 'vCLS*' } | |
### Create empty hash table | |
$hashtable = @{} | |
### Fill hash table with a mapping VM <> host | |
foreach ($i in $AllVMs) { | |
$hashtable.add($i.name, $i.vmhost) | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<# | |
.SYNOPSIS | |
No parameters needed. Just execute the script. | |
.DESCRIPTION | |
This script will shut down all VMs, the ESXi hosts that were running the VMs, the vCenter VM | |
and, at the end, the ESXi host that was running the vCener VM. | |
Please modify all necessary variables. Make sure that you read the comments! | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get events | |
$Event = Get-EventLog -LogName Security -InstanceId 4720 -Newest 1 | |
#get some details | |
$User = $Event.ReplacementStrings[0] | |
$Creator = $Event.ReplacementStrings[4] | |
$Domain = $Event.ReplacementStrings[5] | |
# smtp server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get events | |
$Event = Get-EventLog -LogName Security -InstanceId 4756 -Newest 1 | |
#get some details | |
$User = $Event.ReplacementStrings[0] | |
$Antragsteller = $Event.ReplacementStrings[6] | |
$Gruppe = $Event.ReplacementStrings[2] | |
# smtp server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get events | |
$Event = Get-EventLog -LogName Security -InstanceId 4732 -Newest 1 | |
#get some details | |
$User = $Event.ReplacementStrings[0] | |
$Antragsteller = $Event.ReplacementStrings[6] | |
$Gruppe = $Event.ReplacementStrings[2] | |
# smtp server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get events | |
$Event = Get-EventLog -LogName Security -InstanceId 4728 -Newest 1 | |
#get some details | |
$User = $Event.ReplacementStrings[0] | |
$Antragsteller = $Event.ReplacementStrings[6] | |
$Gruppe = $Event.ReplacementStrings[2] | |
# smtp server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#Get events | |
$Event = Get-EventLog -LogName Security -InstanceId 4740 -Newest 1 | |
#get some details | |
$User = $Event.ReplacementStrings[0] | |
$Computer = $Event.ReplacementStrings[1] | |
$Domain = $Event.ReplacementStrings[5] | |
# smtp server |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#requires -Version 2 | |
#requires -PSSnapin VMware.VimAutomation.Core | |
function Get-LUNPathState { | |
<# | |
.SYNOPSIS | |
No parameters needed. Just execute the script. | |
.DESCRIPTION | |
This script outputs the number of paths to each LUN. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Replace srv_exchange with the desired server name and ip address | |
# Add one server object for each of your Exchange servers | |
add server srv_exchange1 x.x.x.x | |
add server srv_exchange2 x.x.x.y | |
# Replace x.x.x.x with the desired IP address | |
add cs vserver cs_vsrv_exchange SSL x.x.x.x 443 -cltTimeout 180 -caseSensitive OFF | |
add lb vserver lb_vsrv_exchange_owa SSL 0.0.0.0 0 -persistenceType NONE -cltTimeout 180 | |
add lb vserver lb_vsrv_exchange_ecp SSL 0.0.0.0 0 -persistenceType NONE -cltTimeout 180 | |
add lb vserver lb_vsrv_exchange_ews SSL 0.0.0.0 0 -persistenceType NONE -cltTimeout 180 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Liste aller Mailboxen | |
$Mailboxes = Get-Mailbox -OrganizationalUnit "OU=lamadrama,DC=domain,DC=local" | Sort-Object -Property Alias | |
# Liste der fehlgeschlagenen Mailboxen | |
$FailedMailboxes = @() | |
# Begrenzt die Anzahl der zu verarbeitenden Mailboxen | |
# $Mailboxes = $Mailboxes[0..4] | |
# Hier passiert die Magie... |
NewerOlder