Gordo

//Gordo
Gordo

Forum Replies Created

Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • Gordo
    Participant
    Post count: 11

    Okay, I figured this out. I already knew about the default log created at C:\Windows\Logs\Software, so thanks to the folks who responded about that.

    What I was looking for was a separate log file that was specific to just the MSI install I was running within the larger PowerShell script. As I’d stated, I was running that with the Execute-MSI command from within the PowerShell script.

    And it turns out you CAN generate a log file specific to the MSI install. What you CAN’T do, apparently, is specify a location. So instead of using -LogName “C:\Windows\DeployLogs\DRA.log”, what I really needed to do was -LogName “DRA.log”.

    This creates a log file specific to the MSI install, and that log file, along w/ the default PowerShell log file for the entire script, will be located in C:\Windows\Logs\Software.

    Problem solved!

  • Gordo
    Participant
    Post count: 11

    Thanks for the info, Pelle. I’m not so much concerned about what users are doing during the task sequence, but rather, immediately prior.

    The task sequence I have installs Office 365 and the latest version of our anti-virus. I know I can also do separate deploys for each of these applications (using SCCM 2012), but I thought a task sequence offered some benefits that separate deploys didn’t.

    And so here’s why I brought up the question in the first place: let’s say there’s a user, and that user is composing an email, working on a spreadsheet, and creating some documentation in Word. And let’s say that as an SCCM administrator, I’ve created an Office 365 application in SCCM 2012, and that I’ve used the PoSH App Deploy Toolkit.

    When the mandatory deploy time arrives, because of how I’ve coded the PowerShell script, the user sees a nice dialog saying, “Hey, you’ve got these applications open, but they need to close so I can perform this install. Save your work and close them, or click the other button to just continue on if you don’t care about saving your work”. User saves his/her work and performs the install. All is well.

    Using a task sequence, though, the user never sees that dialog, and all their processes are killed. Install runs. but now we have an angry user who’s lost a fair amount of work-in-progress.

    I reckon a workaround would be to write a program that does the detection of open apps and alerts the user, and create that outside of the PoSH Toolkit, then include it in the task sequence. However, it would be nice for the PoSH Toolkit to at least have the option to turn on/off user notifications while running a task sequence.

    At any rate, your answer helps clears up the mystery for me, so thank you!
    Using the Application model in SCCM, running my PowerShell App Deploy Toolkit (triggering Deploy-Application.exe), I as the user

  • Gordo
    Participant
    Post count: 11

    Thanks, Aman. That was helpful. I can now detect the registry key/value I’m searching for while running in the System context, as would be the case during an SCCM deployed installation.

    However, I’m now having trouble deleting the registry key for all users.

    Here’s what I’m trying to accomplish:
    Search for a particular registry key and value in the HKCU hive. This key may exist for multiple users of the computer.
    If the key exists, delete its existence in all user hives, not just the current one.

    What I’m experiencing now is that if I run my code in the System context (I’m using psexec to launch a command window in the System context), the registry key is successfully detected, but only deleted for the user who is currently logged in. If I log in as a different user, the registry key still exists.

    Here’s the code I’m testing with:
    # Test that the registry path exists.
    $regkey = (Test-RegistryValue -Key ‘HKCU:\ABC_TEST’ -Value ‘test’ -SID $RunAsActiveUser.SID)

    If ($regkey) {
    Show-DialogBox -Title ‘Found regkey’ -Text ‘REGKEY EXISTS’
    Remove-RegistryKey -Key ‘HKCU:\ABC_TEST’ -Recurse -SID $RunAsActiveUser.SID
    }

  • Gordo
    Participant
    Post count: 11

    Thanks, all. Good to know where the log file is located. And cmtrace is definitely my friend. 🙂

Viewing 4 posts - 1 through 4 (of 4 total)