August, 2013

  • Creating Lab Computer Objects

    So I’m getting my preparation done for TechEd 2013 on the Gold Coast and needed to fill my ConfigMgr hierarchy with some dummy computer objects. My session being PowerShell for ConfigMgr 2012 SP1, of course I went straight to PowerShell to do the work for me. 

    I’m not looking for anything too special; 1000 laptops, 1000 desktops and 500 servers for my demo domain contoso.com.

    ConfigMgr can be a little picky when it comes to AD System Discovery, such as requiring a matching DNS record and a valid Operating System value. All of the options below are required otherwise you get errors in the ADSysDis.log.

     

    Here’s my script (note: you must have the Active Directory PowerShell module installed on the local machine)

     

    Import-Module ActiveDirectory
    $Count=1
    $LaptopCount = 1001
    $DesktopCount = 1001
    $ServerCount = 501
    # Create Laptops
    While ($Count -lt $LaptopCount)
    {
    New-ADComputer -Name "CON-LAP-$Count" -DNSHostName "CON-LAP-$Count.contoso.com" -OperatingSystem "Windows 7 Enterprise" -OperatingSystemVersion "6.1 (7600)"
    Add-DnsServerResourceRecord -ZoneName contoso.com -Name "CON-LAP-$Count" -IPv4Address "192.168.169.123" -A
    $Count = $Count + 1
    }
    $Count = 1
    # Create Desktops
    While ($Count -lt $DesktopCount)
    {
    New-ADComputer -Name "CON-DSK-$Count" -DNSHostName "CON-DSK-$Count.contoso.com" -OperatingSystem "Windows 7 Enterprise" -OperatingSystemVersion "6.1 (7600)"
    Add-DnsServerResourceRecord -ZoneName contoso.com -Name "CON-DSK-$Count" -IPv4Address "192.168.169.123" -A
    $Count = $Count + 1
    }
    $Count = 1
    # Create Servers
    While ($Count -lt $ServerCount)
    {
    New-ADComputer -Name "CON-SVR-$Count" -DNSHostName "CON-SVR-$Count.contoso.com" -OperatingSystem "Windows Server 2012 Enterprise" -OperatingSystemVersion "6.2 (9200)"
    Add-DnsServerResourceRecord -ZoneName contoso.com -Name "CON-SVR-$Count" -IPv4Address "192.168.169.123" -A
    $Count = $Count + 1
    }

    Active Directory Computer accounts

    image

    DNS A Records

    image

    Matt Shadbolt

  • Teched Australia 2013: Powershell for ConfigMgr 2012 SP1

     

    SMIC1608_blogBling_speaking For the second year running, I’ll be speaking at the Teched Australia 2013 conference on the Gold Coast, Australia.

    The session will cover the Powershell integration into ConfigMgr 2012 SP1.

    I’ll be posting all the scripts, video and transcript after the event.

    Hope to see you there!

    Powershell for ConfigMgr 2012 SP1
    Wednesday, September 4
    5:00 PM – 6:15 PM
    Meeting Room 7&8
    http://techedsessions.cloudapp.net/SessionDetail.aspx?id=2287