Posts RSS Comments RSS 253 Posts and 399 Comments till now

Archive for May, 2009

blog: Import/Export XenApp Applications with Powershell

If there is one functionality that has been requested from myself and Citrix it is the ability to import/export applications.

With the XenApp cmdlets this is super trivial.

This is the SUPER COMPLEX Script ;)

Get-XAApplication -full | Export-Clixml .MyApps.txt
# Make sure the Apps are as you want
Import-Clixml .MyApps.txt
# To Import
Import-Clixml .MyApps.txt| New-XAApplication
# Lets see what apps we have now (I added the Imported)
Get-XAApplication | select BrowserName

Not at all complex is it? Great stuff.

Here is a demo that shows how to do it.
Download XenAppExport Demo

blog: XenDesktop Demo

While I focused most of my time on the XenApp cmdlets I did do a demo of the XenDesktop cmdlets.

Click HERE to download.

blog: XenApp cmdlet beta? when?

I suspect they will be available in beta form in the next month or so. If I hear any firmish dates I will let you know.

Either way… I can assure you it is worth the wait. This is good stuff :)

XenApp cmdlet beta… when?

I suspect they will be available in beta form in the next month or so. If I hear any firmish dates I will let you know.

Either way… I can assure you it is worth the wait. This is good stuff :)

XenDesktop Demo

While I focused most of my time on the XenApp cmdlets I did do a demo of the XenDesktop cmdlets.

Click HERE to download.

Import/Export XenApp Applications with Powershell

If there is one functionality that has been requested from myself and Citrix it is the ability to import/export applications.

With the XenApp cmdlets this is super trivial.

This is the SUPER COMPLEX Script ;)

Get-XAApplication -full | Export-Clixml .\MyApps.txt
# Make sure the Apps are as you want
Import-Clixml .\MyApps.txt
# To Import
Import-Clixml .\MyApps.txt| New-XAApplication
# Lets see what apps we have now (I added the Imported)
Get-XAApplication | select BrowserName

Not at all complex is it? Great stuff.

Here is a demo that shows how to do it.
Download XenAppExport Demo

New XenApp cmdlets demo from Synergy

I have to say… the XenApp guys at Citrix get it and I mean they really get it. We all know there are areas where Citrix has blew it in the Powershell space, but this is not one of them (good time to note that Citrix has taken the feedback from the community and is changing things.)

btw… You can catch a vid of me and Brian Madden discussing Powershell HERE. If I sound a tad distracted… I am. This was done in the Expo hall with 1000s of people walking around. I was doing my best not to yell out “LOOK!… SHINY!”

I had the privilege of showing off the new XenApp cmdlets to the world at Synergy and thought I would share the demo’s with you guys as well.

Ok… back to the blog at hand :)

NOTE: It requires 4.5 with HR3 and above for most functionality. XenApp5 for full functionality.

Here is the first demo that demo’s Get-XAFarm, Get-XAFarmConfiguration, Get-XAServer, and Get-XAApplication

Download XenAppDemo

Here is the list of the cmdlets included, sorted by verb:

Verb: Add
Name
—-
Add-XAAdministratorPrivilege
Add-XAApplicationAccount
Add-XAApplicationFileType
Add-XAApplicationServer
Add-XALoadEvaluatorServer
Add-XASessionPrinter

Verb: Clear
Name
—-
Clear-XAConfigurationLog

Verb: Connect
Name
—-
Connect-XASession

Verb: Copy
Name
—-
Copy-XAApplication

Verb: Disable
Name
—-
Disable-XAAdministrator
Disable-XAApplication
Disable-XAPolicy
Disable-XAServerLogOn

Verb: Disconnect
Name
—-
Disconnect-XASession

Verb: Enable
Name
—-
Enable-XAAdministrator
Enable-XAApplication
Enable-XAPolicy
Enable-XAServerLogOn

Verb: Get
Name
—-
Get-XAAccount
Get-XAAccountAuthority
Get-XAAdministrator
Get-XAAdministratorFolder
Get-XAAdministratorPrivilege
Get-XAApplication
Get-XAAppliedPolicy
Get-XAAutoReplicatedPrinterDriver
Get-XAClientModule
Get-XAClientPrinter
Get-XAConfigurationLog
Get-XAFarm
Get-XAFarmConfiguration
Get-XAFileType
Get-XAFolder
Get-XAHmrTest
Get-XAIconStream
Get-XALoadEvaluator
Get-XAMemoryOptimization
Get-XAOfflineLicense
Get-XAPolicy
Get-XAPolicyConfiguration
Get-XAPolicyFilter
Get-XAPrinter
Get-XAPrinterDriver
Get-XAPrinterDriverCompatibility
Get-XAPrinterDriverMapping
Get-XAPrintServer
Get-XAProfileApplication
Get-XAResultantPolicy
Get-XAServer
Get-XAServerConfiguration
Get-XAServerLoad
Get-XASession
Get-XASessionPrinter
Get-XASessionProcess
Get-XAStreamingSession
Get-XAVirtualIPRange
Get-XAZone

Verb: Import
Name
—-
Import-XALegacyApplication
Import-XAPrintServer

Verb: Move
Name
—-
Move-XAApplication
Move-XAFolder
Move-XAServer

Verb: New
Name
—-
New-XAAdministrator
New-XAApplication
New-XAAutoReplicatedPrinterDriver
New-XAClientPrinter
New-XAFolder
New-XAHmrTest
New-XAIcaFile
New-XALoadEvaluator
New-XAPolicy
New-XAPrinterDriverCompatibility
New-XAPrinterDriverMapping
New-XAVirtualIPRange

Verb: Remove
Name
—-
Remove-XAAdministrator
Remove-XAAdministratorPrivilege
Remove-XAApplication
Remove-XAApplicationAccount
Remove-XAApplicationFileType
Remove-XAApplicationServer
Remove-XAAutoReplicatedPrinterDriver
Remove-XAClientPrinter
Remove-XAFolder
Remove-XAHmrTest
Remove-XALoadEvaluator
Remove-XALoadEvaluatorServer
Remove-XAPolicy
Remove-XAPrinterDriverCompatibility
Remove-XAPrinterDriverMapping
Remove-XAPrintServer
Remove-XAServer
Remove-XASessionPrinter
Remove-XAVirtualIPRange

Verb: Rename
Name
—-
Rename-XAApplication
Rename-XAFolder
Rename-XAHmrTest
Rename-XALoadEvaluator
Rename-XAPolicy
Rename-XAZone

Verb: Replicate
Name
—-
Replicate-XAPrinterDriver

Verb: Reset
Name
—-
Reset-XAClientPrinter

Verb: Send
Name
—-
Send-XASessionMessage

Verb: Set
Name
—-
Set-XAAdministrator
Set-XAAdministratorFolder
Set-XAApplication
Set-XAFarmConfiguration
Set-XAHmrTest
Set-XALoadEvaluator
Set-XAPolicy
Set-XAPolicyConfiguration
Set-XAPolicyFilter
Set-XAPrinterDriverCompatibility
Set-XAPrinterDriverMapping
Set-XAServerConfiguration
Set-XAServerEdition
Set-XAServerZone
Set-XASessionPrinter

Verb: Stop
Name
—-
Stop-XASession
Stop-XASessionProcess

Verb: Test
Name
—-
Test-XAConfigurationLog
Test-XALicenseServer

Verb: Update

Name
—-
Update-XAFileType
Update-XAPrinter

I know it was slow coming, but here it is! (PhillyCodeCamp)

I apologize for taking so long to post this, but better late than never

Click HERE to download zip file with slides and vids.

blog: Breaking down DCDiag.exe to an object

Using some regex magic and some custom object mojo I threw together this DCDiag objectifier.

These are very early bits (only spent a few minutes on it) and may not go any further as I think this would be better as a cmdlet, but it was fun to play with and show some of the POWER you have at your finger tips.

The Code

$DCDiag = Get-Content c: empdcdiag.txt

# Creating the DCDiag object
$DCDiagObject = "" | Select-Object Server,Advertising,SPNs,KnownRoles,Tests
$DCDiagObject.Server = ""
$DCDiagObject.Advertising = @()
$DCDiagObject.KnownRoles = @()
$DCDiagObject.SPNs = @()
$DCDiagObject.Tests = @()

# Setting up RegEXs here so they are easier to consume for the viewer
$DCNameRegex = "^s** Connecting to directory service on server (?<DCName>w+)."
$Advertising = "^s+ThesDCsw*sissadvertisingsass(a|an|having a)s(?<Type>.*)"
$KnownRolesRegex = "^.*Roles(?<Role>.*)sOwner = CN=NTDS Settings,CN=(?<Holder>w*),"
$SPNsRegex = "^s+* SPN found :(?<SPN>.*)"
$StartRegex = "^s*.+s(?<Target>w+)s(?<Result>w+)stests(?<Test>w+)"

# Getting stuff done
switch -regex ($DCDiag)
{
    $DCNameRegex        {$DCDiagObject.Server = $matches.DCName}
    $Advertising        {$DCDiagObject.Advertising += $matches.Type}
    $KnownRolesRegex    {$DCDiagObject.KnownRoles += $matches.Role}
    $SPNsRegex          {$DCDiagObject.SPNs += $matches.SPN}
    $StartRegex         {
                            $myobj = "" | Select-Object Target,Test,Result
                            $myobj.Target = $matches.Target
                            $myobj.Test = $matches.Test
                            $myobj.Result = $matches.Result
                            $myobj | Add-Member -MemberType ScriptMethod -name ToString -value {$this.Test} -force
                            $DCDiagObject.Tests += $myobj
                        }
}

# outputting object
$DCDiagObject

« Prev