12 nov 2012

SCCM by Davis

SCCM by Davis


Rod Trent posted an update in the group System Center Configuration Manager 2012: Slow logon hotfix KB2617858 and ConfigMgr Client Health

Posted: 12 Nov 2012 02:16 PM PST

Rod Trent posted an update in the group System Center Operations Manager: SCOM 2007 R2 - The term 'Get-ManagementServer' is not […]

Posted: 12 Nov 2012 02:15 PM PST

Rod Trent posted an update in the group Microsoft Desktop Optimization Pack (MDOP): Config Pack released to monitor and remediate UE-V

Posted: 12 Nov 2012 01:27 PM PST

Rod Trent wrote a new post, Config Pack released to monitor and remediate UE-V

Posted: 12 Nov 2012 01:26 PM PST

With the recent release of User Experience Virtualization, it's a welcome sight to see a Configuration Pack released that can monitor and manage the configuration of the UE-V clients.

This Config Pack monitors […]

Comments: 0

Rod Trent posted an update in the group Windows RT: Is the Windows RT Surface a good business solution?

Posted: 12 Nov 2012 11:24 AM PST

Rod Trent posted an update in the group Microsoft Surface: Is the Windows RT Surface a good business solution?

Posted: 12 Nov 2012 11:24 AM PST

Rod Trent posted an update in the group Windows 8: Zoom, navigate and organize the Windows 8 Start screen

Posted: 12 Nov 2012 11:23 AM PST

Rod Trent wrote a new post, Zoom, navigate and organize the Windows 8 Start screen

Posted: 12 Nov 2012 11:22 AM PST

ThumbnailAs most of you know, Microsoft has replaced or transformed the pre-Windows 8 Start button into a Start "screen".  All apps that install sit on the horizontally scrollable, tiled Windows menu.  Anytime you install […]

Comments: 0

Rod Trent wrote a new post, Is the Windows RT Surface a good business solution?

Posted: 12 Nov 2012 10:56 AM PST

I could end this post right here, right now, with a single word.  But, I won't.  And, as someone who carefully considers all the nuances of a new technology, my single word statement could be taken in a number of […]

Comments: 0

Enhansoft wrote a new post, Reminder to Request November’s Free SSRS Report

Posted: 12 Nov 2012 10:44 AM PST

ThumbnailThis month's free SSRS report is Software Metering Dashboard. This report normally costs $200, but for this month only it is free!

Request your free copy by sending an email to Info at Enhansoft.

Software […]

Comments: 0

LTI/ZTI PowerShell: Exit codes

Posted: 27 Sep 2012 09:00 PM PDT

When you run a script in your deployments, it's good practice to let MDT/SCCM know how the script has ended. This will determine how your task sequence proceeds. You do this by exiting the script with a return code.

I've removed some of the enhancements to my Rename-Computer script to demonstrate Exit codes.

    Param (   [String]$Name = $TSEnv:OSDComputername,   [String]$WorkGroupName  )    Begin{   Import-Module ZTIUtility  }    Process{   # Rename the Computer using WMI   $Result = (Get-WmiObject win32_computersystem).rename($Name)     If ($Result.ReturnValue -ne 0) {     Write-Error "Error renaming computer"     Exit $Result.ReturnValue   }    # Join a Workgroup   Add-Computer -WorkGroupName $WorkGroupName -WarningAction SilentlyContinue   If ($? -eq $false) {     Write-Error "Error Joining Workgroup"     Exit 1   }  }    End{   Write-Host "The requested operation was successful. Changes will not be effective until the system is rebooted."   Exit 0  }  

There are 2 commands in the script and I've handled them differently. If there are no errors then the script will reach the end of the script and exit with the desired exit code.

Why exit with code 0? Well it's not my choice but if you follow the MSDN – list of system error codes then you'll see that the success exit code is 0.

ERROR_SUCCESS    0 (0x0)    The operation completed successfully.

A reboot is 3010:

ERROR_SUCCESS_REBOOT_REQUIRED    3010 (0xBC2)    The requested operation is successful. Changes will not be effective until the system is rebooted.

So why not use 3010 as this script will always require a reboot after a successful execution.? Well, I would but if your script exits with anything else from 0 then MDT gives you a great "Danger! Will Robinson!" at the end.

The 2 commands in the script work differently so I've handled them differently. The script passes the rename computer command to a $Results variable and checks that it has returned with a 0. if not then it passes the ReturnValue to the exit code.

With the join workgroup command the script checks that the last command has executed without error by testing the last completed action variable $?. If it is not true then the script exits with the return code 1.

Remember you only have to use Write-Error and non 0 codes if you want fire and brimstone at the end of your deployments, in response to undesired executions.

In some cases, you may wish to simply report the non 0 codes and exit with a friendly Write-Host message.

Additional reading:
Scripting Guy Blogs – Error Handling
Windows PowerShell Exit Codes

fabio senni replied to the forum topic SW whose installation reboots computer: can I use a TS to install it? in the group System Center Configuration Manager 2007

Posted: 12 Nov 2012 05:34 AM PST

Additional info: since the applications (all of them) are installed fine, I could just ignore this error. And, I'm going to do so, but... I'd just like to understabnd what happens!

Comments: 0

fabio senni replied to the forum topic SW whose installation reboots computer: can I use a TS to install it? in the group System Center Configuration Manager 2007

Posted: 12 Nov 2012 05:32 AM PST

Hello Kim,
thanks for your reply.
First, let me say that 90 and 5 don't make 100 - sorry about this typo :-) but unfortunately my issue appears 90%, not 10%, of the times!
I am not trying to deploy Software […]

Comments: 0

Cliff Hobbs wrote a new post, [MDT] Where can I get a list of Default Input Locale values and Language Packs for Windows?

Posted: 12 Nov 2012 05:17 AM PST

Question:
I need to configure various languages and input locales within MDT. Where can I obtain a list of valid values?
Answer:
The MDT - Useful Links page contains various links to information on the […]

Comments: 0

Rod Trent posted an update in the group Windows 8: How To Refresh Or Reset Your Windows 8 PC [Complete Guide]

Posted: 12 Nov 2012 04:58 AM PST

Rod Trent posted an update in the group The Word at myITforum: John 1:1-5 1 In the beginning was the Word, and the Word […]

Posted: 12 Nov 2012 04:52 AM PST

John 1:1-5

1 In the beginning was the Word, and the Word was with God, and the Word was God.
2 The same was in the beginning with God.
3 All things were made by him; and without him was not any thing made that was made.
4 In him was life; and the life was the light of men.
5 And the light shineth in darkness; and the darkness comprehended it not.

Comments: 0

Kim Cross replied to the forum topic SW whose installation reboots computer: can I use a TS to install it? in the group System Center Configuration Manager 2007

Posted: 12 Nov 2012 03:31 AM PST

Hi Fabio,
From my expereince the reboot outside a TS restart computer, shouldnt be an issue - the SCCM client install task in an OSD does this - so.... have you tried the continue on error tick box - a fudge I […]

Comments: 0

Kim Cross joined the group System Center Configuration Manager 2007

Posted: 12 Nov 2012 03:12 AM PST

Comments: 0

Vicente Tejerina became a registered member

Posted: 12 Nov 2012 02:07 AM PST

Comments: 0

Andrew Hurst joined the group Application Deployment

Posted: 12 Nov 2012 01:21 AM PST

Comments: 0

No hay comentarios:

Publicar un comentario

SCCM by Davis