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-xaserver |% { | |
gwmi Win32_Service -ComputerNAme $_.ServerName -Filter 'Name="cpsvc"' |% { | |
sc.Exe \\$($_.__SERVER) failure $($_.name) reset= 0 actions= restart/60000/restart/60000 | |
} | |
} |
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-xaserver |% { | |
gwmi Win32_Service -ComputerNAme $_.ServerName -Filter 'Name="cpsvc"' } |select __SERVER,@{N="failure";E={ | |
(sc.exe \\$($_.__SERVER) qfailure $($_.Name) | select-string 'FAILURE') -ne $null | |
}} |
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 xml.etree.ElementTree as ET | |
import importlib | |
import sys | |
import os | |
if len(sys.argv) > 1: | |
xmlfile = sys.argv[1] | |
else: | |
xmlfile = os.path.normpath( os.getcwd() + "/backup.xml") | |
print(xmlfile) |
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-xaserver -FolderPAth $FOLDERPATH |% { | |
$sv = $_.ServerName; quser /SERVER:$($_.serverNAme) |% { | |
$arrT = @( $_ -Split ' ' |? { $_ -ne ' '-and $_.length -gt 0 } ); | |
new-object PSobject -property @{"Session" = $arrT[1]; "Inact" = $arrT[6]; "ServerName" = $sv} | |
} | |
} |? { $_.Session -ne 'SESSION' } | sort Inact |
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-xaserver | get-xaserverconfiguration |? {! $_.LicenseServerUseFarmSettings } |%{ set-xaserverconfiguration -ServerNAme $_.ServerName -LicenseServerUseFarmSettings $true } |
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-xaserver | get-xaserverconfiguration |? {! $_.LicenseServerUseFarmSettings } | select ServerName |
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
######################################################### | |
# FileName RemoteInstall.ps1 # | |
# Version 0.3 # | |
# Author Nicolas # | |
######################################################### | |
# ChangeLog # | |
# # | |
# Version 0.3 # | |
# Author Nicolas # | |
# Content Utilisation d'un fichier XML |
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
$TSEKey="SYSTEM\ControlSet001\Control\Terminal Server\WinStations\RDP-Tcp" | |
get-XAserver | %{ | |
$reg=[microsoft.win32.registrykey]::OpenRemoteBaseKey('LocalMachine',$_.ServerName) | |
$copy = $_ | |
$reg.OpenSubKey($TSEKey).getValueNames() |? { $_ -like 'fDisable*'} |% { | |
$copy | Add-member -Type NoteProperty -Name $_ -Value $reg.OpenSubKey($TSEKey).getValue($_) | |
} | |
$copy | |
} | select ServerName, fDisable* |
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-ADOrganizationalUnit -Filter 'OU -like "*Citrix*"' -SearchBase 'dc=fabrikam,dc=com' -Properties * |% { $_.gpLink -split ']' } |? { $_ -match '[0,2]$'} |% {(($_ -replace '\[','').split(';')[0]) -replace 'LDAP://',''} |% { get-adobject $_ -properties * } |sort -Unique DisplayName |% {if( $_.Flags -ne 3 ){if([bool]( gci "$($_.gPCFileSysPath)\User") -eq $false){if([bool](gci "$($_.gPCFileSysPath)\Machine") -eq $false){(get-gpo -Name $_.DisplayName).GpoStatus = "AllSettingsDisabled" }else{(get-gpo -Name $_.DisplayName).GpoStatus = "UserSettingsDisabled"}}else {if([bool](gci "$($_.gPCFileSysPath)\Machine") -eq $false){(get-gpo -Name $_.DisplayName).GpoStatus = "ComputerSettingsDisabled"}ELSE{}}}} } |
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-ADOrganizationalUnit -Filter 'OU -like "*Citrix*"' -SearchBase 'dc=fabrikam,dc=com' -Properties * |% { | |
$_.gpLink -split ']' } |? { | |
$_ -match '[0,2]$'} |% { | |
(($_ -replace '\[','').split(';')[0]) -replace 'LDAP://',''} |% { | |
get-adobject $_ -properties * } | | |
sort -Unique DisplayName |% { | |
if( $_.Flags -ne 3 ){ | |
if([bool]( gci "$($_.gPCFileSysPath)\User") -eq $false){ | |
if([bool](gci "$($_.gPCFileSysPath)\Machine") -eq $false){ | |
(get-gpo -Name $_.DisplayName).GpoStatus = "AllSettingsDisabled" |