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 | |
Reviews and evenly distributes VDA's within a Citrix Hypervisor pool. | |
.DESCRIPTION | |
Reviews and evenly distributes VDA's within a Citrix Hypervisor pool. | |
.PARAMETER XenServer_poolmaster | |
Mandatory string parameter. IP of the Citrix Hypervisor pool master to optimize. | |
.PARAMETER XenServer_networkname | |
Mandatory string parameter. Network name of the Citrix Hpervisor pool's management network | |
.PARAMETER XenServer_SRName |
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 | |
Iterates through list of servers or a single server and retrieves AppLocker Event logs. Can filter the results by log level. | |
.DESCRIPTION | |
Iterates through list of servers or a single server and retrieves AppLocker Event logs. Can filter the results by log level. The data returned is from the last 24 hours. | |
.PARAMETER Computer | |
Optional string parameter. Single server to query applocker logs. If blank, script queries local system. Parameter set=Computer | |
.PARAMETER ComputerList | |
Mandatory string parameter. List of servers to query applocker logs. If blank, script queries local system. Parameter set=ComputerList | |
.PARAMETER LogLevel |
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
{ | |
// Place your global snippets here. Each snippet is defined under a snippet name and has a scope, prefix, body and | |
// description. Add comma separated ids of the languages where the snippet is applicable in the scope field. If scope | |
// is left empty or omitted, the snippet gets applied to all languages. The prefix is what is | |
// used to trigger the snippet and the body will be expanded and inserted. Possible variables are: | |
// $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. | |
// Placeholders with the same ids are connected. | |
// Example: | |
// "Print to console": { | |
// "scope": "javascript,typescript", |
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 | |
Searches Citrix sessions that are running a certain published application and stops it if a session is idle for a certain time. | |
.DESCRIPTION | |
Searches Citrix sessions that are running a certain published application and stops it if a session is idle for a certain time. Logs are generated in the same directory as the script runs. | |
.PARAMETER deliverycontroller | |
Mandatory string parameter. Which Citrix Delivery Controller (farm) to query for session. | |
.PARAMETER pubApp | |
Mandatory string parameter. Which published application to stop. | |
.PARAMETER idletime |
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 | |
Opens WEM Mgmt Console connected to entered WEM Infrastrucure Server | |
.DESCRIPTION | |
Opens WEM Mgmt Console connected to entered WEM Infrastrucure Server | |
.PARAMETER WEMServer | |
Optional string parameter. The WEM Infrastrucure server the WEM Console will connect to. | |
.EXAMPLE | |
PS> open-WemConsole.ps1 | |
Opens the WEM Console connected to the last WEM infrastrcuture 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
function get-pixabayImage { | |
[CmdletBinding()] | |
param ( | |
[parameter(Position = 0, Mandatory = $True )] | |
[ValidateNotNullOrEmpty()] | |
[string]$query, | |
[Parameter(Mandatory = $true)] | |
[ValidateSet("backgrounds", "fashion", "nature", "science", "education", "feelings", "health", "people", "religion", "places", "animals", "industry", "computer", "food", "sports", "transportation", "travel", "buildings", "business", "music")] | |
$category, |
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
$vmtodelete = Get-XenVM | Where-Object {$_.is_a_snapshot -eq $false -and $_.is_a_template -eq $false -and $_.is_control_domain -eq $false -and $_.name_label -eq $virtualMachine} | |
if ($vmtodelete) { | |
if ($vmtodelete.power_state -eq "Halted") { | |
Write-Verbose "$virtualmachine is powered off. Deleting $virtualmachine from $xsn" | |
$vmtodelete.VBDs | Remove-XenVBD #Deletes attached disks | |
$vmtodelete | Remove-XenVM #Deletes VM | |
Get-XenSession -Server $_ | Disconnect-XenServer | |
Exit 0 | |
} else { | |
Write-Warning "$virtualmachine is not powered off. Exiting script" |
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
# Retrieve the information | |
$XenServerVMs = Get-XenVM | Where-Object {$_.is_a_snapshot -eq $false -and $_.is_a_template -eq $false -and $_.is_control_domain -eq $false -and $_.power_state -eq 'running'} | Select-Object name_label | |
$vmCount = $XenServerVMs.count | |
$objctxsrv = new-object System.Object | |
$objctxsrv | Add-Member -type NoteProperty -name XenServer -value $xsn | |
$objctxsrv | Add-Member -type NoteProperty -name 'VM Count' -value ($vmCount) | |
$finalout += $objctxsrv | |
# Disconnect from the XenServer pool | |
Get-XenSession -Server $_ | Disconnect-XenServer |
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
switch ($_) { | |
"192.168.50.1" {$xsn = "XenServerPool1"; break} | |
"192.168.50.2" {$xsn = "XenServerPool2"; break} | |
default {"UNKNOWN XENSERVER"; break} | |
} |
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
# Loop through list of hosts (poolmaster) | |
$xenserver_poolmaster | ForEach-Object { | |
# Connect to XenServer pool | |
Connect-XenServer -Server $_ -Creds $xenserver_credential -SetDefaultSession -NoWarnNewCertificates |
NewerOlder