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
$Searcher = New-Object DirectoryServices.DirectorySearcher | |
$Searcher.Filter = '(&(objectCategory=User)(sAMAccountName=MyUser))' | |
$Searcher.SearchRoot = 'LDAP://dc=ds,dc=example,dc=com' | |
$user = [adsi]$Searcher.FindAll()[0].Path | |
$groups = @($user.memberOf | % { ([adsi]"LDAP://$_").Cn }) | |
$admin = @(Get-xaadministrator | select AdministratorName | % { $_.AdministratorNAme.Split()[0] }) | |
$mygroup = compare-object $groups $admin -ExcludeDifferent -IncludeEqual -Passthru |
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
$xaservers = New-Object System.Collections.ArrayList | |
get-xaserver | select ServerName | sort ServerName | %{ $xaservers.Add( $_.ServerName ) } | |
$jobname = "MyPackage" | |
$IMSetting = new-object -com MetaframeCOM.MetaFrameIMConfig; | |
$IMSetting.jobs | % { | |
if( $_.name -match $jobname){ | |
$_.Servers | % { | |
if( $_.jobStatus -eq 0 -or $_.jobStatus -eq 8 ){ |
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
$username ="MyUser" | |
$password="MyPwd" | |
$dsnfilename="Path/to/my/newdsn" | |
Get-xaserver |% { | |
$serverName = $_.servername | |
$servername | |
get-content New.dsn |%{ if ($_ -like '*WSID*') {"WSID=$servername" }else{$_} } | out-file "\\$($_.ServerNAme)\c$\Path\to\newdsn" |
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-xaapplication MyApp-* |% { set-xaapplication -InputObject $_ -ServerNames (@(get-xaserver -BrowserName $_.BrowserName | %{$_.ServerName } ) + @('MyServer1', 'MyServer2')) } |
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-xaapplication | where { $_.MultipleInstancesPerUserAllowed -eq $True } |%{ set-xaapplication -InputObject $_ -MultipleInstancesPerUserAllowed $false } |
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
@(MyXMLServerList)| select @{N="Server";E={$_}},@{N="State";E={ | |
$url="http://${_}:8085/scripts/wpnbr.dll" | |
$data = '<?xml version="1.0" encoding="UTF-8"?> | |
<!DOCTYPE NFuseProtocol SYSTEM "NFuse.dtd"> | |
<NFuseProtocol version="4.1"> | |
<RequestAddress> | |
<Flags>no-load-bias</Flags> | |
<Name> | |
<AppName>MyApp</AppName> | |
</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
get-content "Path/To/File" |? { $_ -notlike "#[D,S-V]*"} |%{ @($_.Split(" "))[8] }|sort | group | select Name,Count,@{N='HostName',E={[system.net.dns]::GetHostEntry($_.Name}.HostName } } |
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-xaapplication -FolderPath Applications/Path |? {$_.Enabled -eq $false } | set-xaapplication -Enabled $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
$html ="<html> | |
<head> | |
<!--Load the AJAX API--> | |
<script type=`"text/javascript`" src=`"https://www.google.com/jsapi`"></script> | |
<script type=`"text/javascript`"> | |
// Load the Visualization API and the piechart package. | |
google.load('visualization', '1.0', {'packages':['corechart']}); | |
// Set a callback to run when the Google Visualization API is loaded. |
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-xafolder Applications/Path |%{ $_; get-xaapplication -FolderPath $_| select DisplayName |%{“`t$($_.DisplayName)” } } |
OlderNewer