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
#----------------------------------------------------------------------------- | |
# Import PowerCLI Module | |
#----------------------------------------------------------------------------- | |
Add-PSSnapin VMware.VimAutomation.Core | |
#----------------------------------------------------------------------------- | |
# Connect to vCenter Server | |
#----------------------------------------------------------------------------- | |
$Server = Read-Host 'Specify the vCenter Server or ESXi Host to connect to (IP or FQDN)?' | |
Connect-VMwareServer -VMServer $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
#----------------------------------------------------------------------------- | |
# Import PowerCLI Module | |
#----------------------------------------------------------------------------- | |
Add-PSSnapin VMware.VimAutomation.Core | |
#----------------------------------------------------------------------------- | |
# Connect to vCenter Server | |
#----------------------------------------------------------------------------- | |
$Server = Read-Host 'Specify the vCenter Server or ESXi Host to connect to (IP or FQDN)?' | |
Connect-VMwareServer -VMServer $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 4 | |
<# | |
.SYNOPSIS | |
<Overview of script> | |
.DESCRIPTION | |
<Brief description of script> | |
.PARAMETER <Parameter_Name> | |
<Brief description of parameter input required. Repeat this attribute if required> |
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 4 | |
<# | |
.SYNOPSIS | |
<Overview of script> | |
.DESCRIPTION | |
<Brief description of script> | |
.PARAMETER <Parameter_Name> | |
<Brief description of parameter input required. Repeat this attribute if required> |
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 4 | |
<# | |
.SYNOPSIS | |
<Overview of script> | |
.DESCRIPTION | |
<Brief description of script> | |
.PARAMETER <Parameter_Name> | |
<Brief description of parameter input required. Repeat this attribute if required> |
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 4 | |
<# | |
.SYNOPSIS | |
<Overview of script> | |
.DESCRIPTION | |
<Brief description of script> | |
.PARAMETER <Parameter_Name> | |
<Brief description of parameter input required. Repeat this attribute if required> |
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 4 | |
<# | |
.SYNOPSIS | |
Seaches for an RDM with the specified LUN ID. | |
.DESCRIPTION | |
Searches the vCenter environment to find the Virtual Machine that has an RDM configured with a particular LUN ID. | |
.PARAMETER None |
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 4 | |
<# | |
.SYNOPSIS | |
Configure SNMP Settings on ESXi Hosts | |
.DESCRIPTION | |
Connect to vCenter Server and configure all ESXi hosts with SNMP settings | |
.PARAMETER None |
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
$RegKey = (Get-ItemProperty 'HKCU:\Volatile Environment') | |
$RegKey.PSObject.Properties | ForEach-Object { | |
If($_.Name -like '*View*'){ | |
Write-Host $_.Name ' = ' $_.Value | |
} | |
} |
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
Import-Module ActiveDirectory | |
# Set the number of days since last logon | |
$DaysInactive = 90 | |
$InactiveDate = (Get-Date).Adddays(-($DaysInactive)) | |
#------------------------------- | |
# FIND INACTIVE USERS | |
#------------------------------- | |
# Below are four options to find inactive users. Select the one that is most appropriate for your requirements: |