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
# Remove AppSense CCA GUID | |
# "Removing values" | |
If (Get-ItemProperty -Path "HKLM:\Software\AppSense Technologies\Communications Agent" -name "machine id" -ErrorAction SilentlyContinue){ | |
Remove-ItemProperty -Path "HKLM:\Software\AppSense Technologies\Communications Agent" -name "machine id" | |
} | |
If (Remove-ItemProperty -Path "HKLM:\Software\AppSense Technologies\Communications Agent" -name "group id" -ErrorAction SilentlyContinue){ | |
Remove-ItemProperty -Path "HKLM:\Software\AppSense Technologies\Communications Agent" -name "group id" | |
} | |
# "Removing subkeys" | |
Get-Childitem "HKLM:\Software\AppSense\Environment Manager" | Remove-Item |
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
# Create an empty array for results | |
$arrResults = @() | |
# Get the .net view of the virtual machines | |
$objVMViews = Get-View -ViewType "VirtualMachine" | Where-Object {!$_.Config.Template} | |
# Loop through the .net view objects representing the machines | |
ForEach ($objVMView in $objVMViews){ | |
# Loop through the .net view's devices | |
ForEach ($objDevice in $objVMView.Config.Hardware.Device) { |
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
Function Get-PCOIPStatsViaWMI { | |
<# | |
.Synopsis | |
Returns PCOIP statistics via WMI | |
.Description | |
This function displays PCOIP statistics gatherered via WMI from the | |
target machine | |
.Example |
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 the SCSM Native CMDLets | |
Import-Module "C:\Program Files\Microsoft System Center 2012\Service Manager\Powershell\System.Center.Service.Manager.psd1" | |
# Name of your SCSM Server | |
$strSCSMServer = "YourSCSMServer" | |
New-SCSMManagementGroupConnection -ComputerName $strSCSMServer | |
$objRelationshipAssignedToUser = Get-SCSMRelationship -Name "System.WorkItemAssignedToUser" | |
$objRelationshipAffectedUser = Get-SCSMRelationship -Name "System.WorkItemAffectedUser" |
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 -PSSnapin Quest.ActiveRoles.ADManagement | |
Function Remove-StuckVDIMachineFromAdamDatabase { | |
<# | |
.Synopsis | |
Removes an object from View's ADAM database | |
.Description | |
Finds a computer object in View's ADAM database which represents a machine. | |
Probably one stuck in a Deleting "(Missing)" state. Deletes it (with confirmation) |
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
Function Invoke-SubversionScript { | |
<# | |
.Synopsis | |
Runs a script directly from Subversion. | |
.Description | |
Given a valid Subversion URL and credentials (Basic authentication) invokes the script on the local machine. | |
.Parameter Url | |
The URL of the script. Should be a valid URL, and end in PS1 |
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
# Script to deploy linked clones | |
# List of custom attributes which you're wanting to copy from the template or parent to the newly created machine | |
# (Machines deployed from templates no longer inherit CAs in vSphere 4.0) | |
# These help us track provenance, and provide information to the user | |
$arrStrAttributesToCopy = @( | |
"AD Object Location", | |
"Customisation", | |
"Infrastructure Consultant", | |
"Logon Administrator Name", |
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
# Script to connect to a list of vCenter Servers, and get their version numbers, as well as the version numbers of their hosts | |
# Ben Neise | |
# 02/10/09 | |
# Array of vCenter Servers | |
$arrVCenterServers = @("server1","server2","server3") | |
# Create empty arrays for the results | |
$arrTableVCs = @() | |
$arrTableHosts = @() |
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
# Sets up virtual port groups on all hosts connected to a specific vCenter Server | |
# Name of vCenter Server | |
$strVCenterServer = "your.vCenter.Server" | |
# VLANs and associated VPGs | |
$ArrVLANs = @{ | |
"123" = "vlanA"; | |
"456" = "vlanB"; | |
"789" = "vlanC"; |
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 all templates | |
$objTemplates = Get-Template | |
# Loop through the templates | |
ForEach ($objTemplate in $objTemplates){ | |
# Set the $StrInterimTemplateName variable to the template name, replacing the string "Tmpl" with an empty string | |
$StrInterimTemplateName = ($objTemplate.Name -replace("Tmpl","")) | |
# As the string we've just removed might be anywhere in the name, we need to replace double spaces with single | |
$StrInterimTemplateName = ($StrInterimTemplateName -replace(" "," ")) | |
# And also remove trailing spaces from the start, or the end of the string |