Posts RSS Comments RSS 253 Posts and 399 Comments till now

Archive for the 'Active Directory' Category

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: 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: 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

blog: 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

blog: KMS Product Keys

In my previous article: Command line guide for Server Core. I listed a bunch of product keys. I received several emails quickly pointing this out, but I want to ease their minds. It was intentional.

Those are not my nor my companies product keys. Those keys are actually the default keys that tell the Host to use KMS server for activation. You can also find them listed here Volume Activation 2.0 Deployment Guide on the bottom of the article.

blog: Command line guide for Server Core

I have been doing a lot of server core builds as of late and here are list of commands I have found useful.

Set Interface ID
netsh interface set interface name=";Old Name"; newname=";New Name";

Set IP
netsh interface ipv4 set address name=";<ID>"; source=static address=<StaticIP> mask=<SubnetMask> gateway=<DefaultGateway>

Set DNS
netsh interface ipv4 add dnsserver name=";<Interface ID>"; address=<DNSIP> index=1
netsh interface ipv4 add dnsserver name=";ExtraNet"; address=1.1.1.1 index=1

Set Proxy
netsh winhttp set proxy proxy-server=";http=myproxy;https=sproxy:88″ bypass-list=";*.contoso.com";

Set Computer Name
# Use hostname from the command prompt to get current name
netdom renamecomputer <ComputerName> /NewName:<NewComputerName>

Join Domain
netdom join <ComputerName> /domain:<DomainName> /userd:<UserName> /passwordd:*

Set the Default scripting engine to cscript
cscript //H:Cscript

To Activate via KMS server
slmgr -ipk YQGMW-MPWTJ-34KDK-48M3W-X4Q6V
slmgr -skms <KMSServer>:1688
slmgr -ato
slmgr -ato # Yes twice

Running Windows Update
http://msdn.microsoft.com/en-us/library/aa387102(VS.85).aspx

Disable Firewall
netsh advfirewall set allprofiles state off

Allow Remote Desktop
netsh advfirewall firewall set rule group=";remote desktop"; new enable=yes

Allow Remote Administration
netsh advfirewall firewall set rule group=";Remote Administration"; new enable=yes

Allow Remote Firewall Administration
netsh advfirewall firewall set rule group=?Windows Firewall Remote Management? new enable=yes

Allow Ping
netsh firewall set icmpsetting 8

Connect to remote Server Core w/ out domain (this is done on management box)
cmdkey /add:<ServerCore> /user:<UserName> /pass:<password>

Export Security Policy
secedit /export /db secedit.sbd /cfg <Policy File Name>

Import Security Policy
secedit /configure /db secedit.sdb /cfg sctest.inf /overwrite

Allow Remote Disk Management
THIS HAS to be done on BOTH SIDES!!!
netsh advfirewall firewall set rule group=";Remote Volume Management"; new enable=yes

Allow Remote Device Mgr
1. On a Windows Vista or full Server installation, start the Group Policy Object MMC snap-in
2. Connect to the Server Core installation
3. Navigate to Computer ConfigurationAdministrative TemplatesDevice Installation
4. Enable ?Allow remote access to the PnP interface?
5. Restart the Server Core installation
or
Via GPO

Things to Note:
- Firewall rules will have to be re-adjusted after Domain Join

Good Links for more info
Server Core Installation Option of Windows Server 2008 Step-By-Step Guide:
http://technet.microsoft.com/en-us/library/cc753802.aspx#bkmk_managingservercore

Windows Server 2008 Network Shell (Netsh) Technical Reference:
http://www.microsoft.com/downloads/details.aspx?FamilyID=f41878de-2ee7-4718-8499-2ef336db3df5

-Volume Activation 2.0 Deployment Guide
http://technet.microsoft.com/en-us/library/cc303280.aspx#

Product SKUs for Volume Licensing
==================================
Operating System Edition || Product Key
Windows Vista Business || YFKBB-PQJJV-G996G-VWGXY-2V3X8
Windows Vista Business N || HMBQG-8H2RH-C77VX-27R82-VMQBT
Windows Vista Enterprise || VKK3X-68KWM-X2YGT-QR4M6-4BWMV
Windows Vista Enterprise N || VTC42-BM838-43QHV-84HX6-XJXKV
Windows Server 2008 Datacenter || 7M67G-PC374-GR742-YH8V4-TCBY3
Windows Server 2008 Datacenter without Hyper-V || 22XQ2-VRXRG-P8D42-K34TD-G3QQC
Windows Server 2008 for Itanium-Based Systems || 4DWFP-JF3DJ-B7DTH-78FJB-PDRHK
Windows Server 2008 Enterprise || YQGMW-MPWTJ-34KDK-48M3W-X4Q6V
Windows Server 2008 Enterprise without Hyper-V || 39BXF-X8Q23-P2WWT-38T2F-G3FPG
Windows Server 2008 Standard || TM24T-X9RMF-VWXK6-X8JC9-BFGM2
Windows Server 2008 Standard without Hyper-V || W7VD6-7JFBR-RX26B-YKQ3Y-6FFFJ
Windows Web Server 2008 || WYR28-R7TFJ-3X2YQ-YCY4H-M249D

blog: WS2008 R2 Active Directory Webcast – Tomorrow, Friday 4/24

Tomorrow Laura Hunter and Brian Desmond will be doing a webcast discussing and premoting the new Active Directory features in Windows Server 2008 R2 as well as answering AD questions. They have a 90 minute slot and they expect to spend ~45-60 minutes on R2 and the remainder taking questions on the presentation and AD in general.

The webcast is hosted by O?Reilly and is free to attend. If you can?t make it, a recording will be available.

Here are the details:

Registration Link - HERE

Date: Friday, April 24, 2009

Time: 10am PT, San Francisco
6pm - London | 1pm - New York | Sat, Apr 25th at 3am - Sydney | Sat, Apr 25th at 2am - Tokyo | Sat, Apr 25th at 1am - Beijing | 10:30pm - Mumbai

Presented by: Brian Desmond, Laura E. Hunter

Duration: Approximately 90 minutes.

Cost: Free

blog: WS2008 R2 Active Directory Webcast – Tomorrow, Friday 4/24

Tomorrow Laura Hunter and Brian Desmond will be doing a webcast discussing and premoting the new Active Directory features in Windows Server 2008 R2 as well as answering AD questions. They have a 90 minute slot and they expect to spend ~45-60 minutes on R2 and the remainder taking questions on the presentation and AD in general.

The webcast is hosted by O’Reilly and is free to attend. If you can’t make it, a recording will be available.

Here are the details:

Registration Link - HERE

Date: Friday, April 24, 2009

Time: 10am PT, San Francisco 6pm - London | 1pm - New York | Sat, Apr 25th at 3am - Sydney | Sat, Apr 25th at 2am - Tokyo | Sat, Apr 25th at 1am - Beijing | 10:30pm - Mumbai

Presented by: Brian Desmond, Laura E. Hunter

Duration: Approximately 90 minutes.

Cost: Free

blog: More thoughts on cmdlet design

If you were told you needed to move your GUI based management application to Powershell what would you do? How would you approach the design spec so that you maintain what your user base expects while providing the extra benefit of a CLI interface.

This is an interesting problem and one that I expect many will have in the future. I have thought about this at great length and decided that if you take the "task base" approach it is much simpler than you may first expect.

Let me illustrate what I mean using the dnsmgmt.msc interface. How would we go about converting that to a Powershell base cli that we could build a GUI on?

First I would break down the existing GUI into components. Like Servers, Zones, and Records. I would then think about what I could do to those components. Finally I would think of edge case scenarios that do not fit this generic model.

Using this method we would end up with something like this (not complete... just for illustration)

Basic:
------
  • Add-DNSServer
  • Get-DNSServer
  • Set-DNSServer
  • Remove-DNSServer
  • New-DNSZone
  • Get-DNSZone
  • Set-DNSZone
  • Remove-DNSZone
  • New-DNSRecord
  • Get-DNSRecord
  • Set-DNSRecord
  • Remove-DNSRecord
  • ...
Edge Case:
----------
  • Get-DNSInterface
  • Set-DNSInterface
  • Get-DNSRootHint
  • Set-DNSRootHint
  • Get-DNSForwarder
  • Set-DNSForwarder
  • Remove-DNSForwarder
  • ...

Using this method allows you design a scalable GUI bases on a solid CLI while maintaining a consistent.

What do you think?

« Prev - Next »


Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/t/s/h/tshell/html/wp-content/plugins/feedwordpress/feedwordpress_file.class.php on line 64

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/t/s/h/tshell/html/wp-content/plugins/feedwordpress/feedwordpress_file.class.php on line 64

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/t/s/h/tshell/html/wp-content/plugins/feedwordpress/feedwordpress_file.class.php on line 64

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/t/s/h/tshell/html/wp-content/plugins/feedwordpress/feedwordpress_file.class.php on line 64

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/t/s/h/tshell/html/wp-content/plugins/feedwordpress/feedwordpress_file.class.php on line 64

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/t/s/h/tshell/html/wp-content/plugins/feedwordpress/feedwordpress_file.class.php on line 64

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/t/s/h/tshell/html/wp-content/plugins/feedwordpress/feedwordpress_file.class.php on line 64

Warning: file_get_contents(http:) [function.file-get-contents]: failed to open stream: No such file or directory in /home/content/t/s/h/tshell/html/wp-content/plugins/feedwordpress/feedwordpress_file.class.php on line 64