Jump to content


Search the Community

Showing results for tags 'PowerShell'.

  • Search By Tags

    Type tags separated by commas.
  • Search By Author

Content Type


Forums

  • Cloud
    • Azure
    • Microsoft Intune
    • Office 365
    • Windows 365
  • General Stuff
    • General Chat
    • Events
    • Site News
    • Official Forum Supporters
    • Windows News
    • Suggestion box
    • Jobs
  • MDT, SMS, SCCM, Current Branch &Technical Preview
    • How do I ?
    • Microsoft Deployment Toolkit (MDT)
    • SMS 2003
    • Configuration Manager 2007
    • Configuration Manager 2012
    • System Center Configuration Manager (Current Branch)
    • Packaging
    • scripting
    • Endpoint Protection
  • Windows Client
    • how do I ?
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows Vista
    • Windows XP
    • windows screenshots
  • Windows Server
    • Windows Server General
    • Active Directory
    • Microsoft SQL Server
    • System Center Operations Manager
    • KMS
    • Windows Deployment Services
    • NAP
    • Failover Clustering
    • PKI
    • Hyper V
    • Exchange
    • IIS/apache/web server
    • System Center Data Protection Manager
    • System Center Service Manager
    • System Center App Controller
    • System Center Virtual Machine Manager
    • System Center Orchestrator
    • Lync
    • Application Virtualization
    • Sharepoint
    • WSUS

Find results in...

Find results that contain...


Date Created

  • Start

    End


Last Updated

  • Start

    End


Filter by number of...

Joined

  • Start

    End


Group


Website URL


Location


Interests

  1. Hello All, I have a Powershell script that I use to create multiple Software Update Deployments and it works perfectly (well almost). The last piece I'm missing is automating the deadline date. Currently I just have it getting the current date and adding 5 days. I then go into each deployments properties and change the date/time to the desired info. I've been trying to work out automating this a little bit by adding a variable for a static date/time. I can then change this date (time will always be the same) to the desired info at script run. Below is what I've come up with so far. The -EnforcementDeadlineDay piece works on it own, in that it outputs the correct date with an incremented time. However once I put it in the full script i get the below errors. Any help is much appreciated. Cheers, Mike Script: # Monthly Deployment Date #$DeploymentDate = Get-Date -Format "yyyy-MM" $DeploymentDate = (Get-Date).AddDays(-30).ToString("yyyy-MM") $DeadlineDate = Get-Date -Month 08 -Day 07 -Year 2016 -Hour 17 -Minute 0 -Second 0 # Software Update Groups $SUPGroupName1 = "EN5 - EDC - Year 2013- ($DeploymentDate) Reference 1" $SUPGroupName2 = "EN5 - EDC - Year 2013+ ($DeploymentDate) Reference 2" #Load Configuration Manager PowerShell Module Import-module ($Env:SMS_ADMIN_UI_PATH.Substring(0,$Env:SMS_ADMIN_UI_PATH.Length-5) + '\ConfigurationManager.psd1') #Get SiteCode and set Powershell Drive $SiteCode = Get-PSDrive -PSProvider CMSITE Set-location $SiteCode":" # Create Standard Deployments (Group 1) $DeploymentName = "EN5 - PM Dev ($DeploymentDate) Reboot Deployment # 1" $DeploymentCount = 6 $Count = 0 1..$DeploymentCount | ForEach-Object { $Count++ Write-Progress -Activity "Creating Deployment Group 1" -Id 1 -Status "Running $($Count) / $($DeploymentCount)" -PercentComplete (($Count / $DeploymentCount) * 100) Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "$SUPGroupName1" -CollectionName "EN5 - PM - Deployment $Count (Lab)" -DeploymentName "$DeploymentName-$Count" -DeploymentType Required -VerbosityLevel AllMessages -TimeBasedOn LocalTime -DeploymentAvailableDay (Get-Date) -EnforcementDeadlineDay $DeadlineDate.ToLongDateString()$DeadlineDate.Addhours($Count).ToLongTimeString() -UserNotification HideAll -SoftwareInstallation $True -AllowRestart $True -RestartServer $False -RestartWorkstation $False -ProtectedType RemoteDistributionPoint -UnprotectedType UnprotectedDistributionPoint -GenerateSuccessAlert $False -DisableOperationsManagerAlert $False -GenerateOperationsManagerAlert $False -PersistOnWriteFilterDevice $False -UseBranchCache $False } Write-Progress -Activity "Creating Deployment Group 1" -Id 1 -Completed Errors: Start-CMSoftwareUpdateDeployment : A positional parameter cannot be found that accepts argument '6:00:00 PM'. At E:\scripts\EN5 - CreateDeployments - LAB.ps1:24 char:5 + Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "$SUPGroupName1" - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: ( [Start-CMSoftwareUpdateDeployment], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ConfigurationManagement.Cmdlets.Sum.Commands.StartSoftwareUpdateDeploymentCommand Start-CMSoftwareUpdateDeployment : A positional parameter cannot be found that accepts argument '7:00:00 PM'. At E:\scripts\EN5 - CreateDeployments - LAB.ps1:24 char:5 + Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "$SUPGroupName1" - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: ( [Start-CMSoftwareUpdateDeployment], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ConfigurationManagement.Cmdlets.Sum.Commands.StartSoftwareUpdateDeploymentCommand Start-CMSoftwareUpdateDeployment : A positional parameter cannot be found that accepts argument '8:00:00 PM'. At E:\scripts\EN5 - CreateDeployments - LAB.ps1:24 char:5 + Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "$SUPGroupName1" - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: ( [Start-CMSoftwareUpdateDeployment], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ConfigurationManagement.Cmdlets.Sum.Commands.StartSoftwareUpdateDeploymentCommand Start-CMSoftwareUpdateDeployment : A positional parameter cannot be found that accepts argument '9:00:00 PM'. At E:\scripts\EN5 - CreateDeployments - LAB.ps1:24 char:5 + Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "$SUPGroupName1" - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: ( [Start-CMSoftwareUpdateDeployment], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ConfigurationManagement.Cmdlets.Sum.Commands.StartSoftwareUpdateDeploymentCommand Start-CMSoftwareUpdateDeployment : A positional parameter cannot be found that accepts argument '10:00:00 PM'. At E:\scripts\EN5 - CreateDeployments - LAB.ps1:24 char:5 + Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "$SUPGroupName1" - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: ( [Start-CMSoftwareUpdateDeployment], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ConfigurationManagement.Cmdlets.Sum.Commands.StartSoftwareUpdateDeploymentCommand Start-CMSoftwareUpdateDeployment : A positional parameter cannot be found that accepts argument '11:00:00 PM'. At E:\scripts\EN5 - CreateDeployments - LAB.ps1:24 char:5 + Start-CMSoftwareUpdateDeployment -SoftwareUpdateGroupName "$SUPGroupName1" - ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidArgument: ( [Start-CMSoftwareUpdateDeployment], ParameterBindingException + FullyQualifiedErrorId : PositionalParameterNotFound,Microsoft.ConfigurationManagement.Cmdlets.Sum.Commands.StartSoftwareUpdateDeploymentCommand
  2. Hi, I'm looking for a simple Poweshell script to delete computers from SCCM. I found various examples, but nothing seems to works well. Also this script from from Microsoft is not doing the trick for me : https://gallery.technet.microsoft.com/scriptcenter/Remove-old-Active-7fc40c61 Suggestions, examples is welcome ! Thanks!
  3. Dear m8's, We got an Application deployed to a Usercolletion and to Devicecollection. As soon as we add any powershell-script based global condition to the requirements of the deploymenttype the application disappears from the Softwarecenter (Device-deployment) but it stays in the Softwarecatalog (User-deployment) If the Condition is Powershell and returns Stringit fails. if it is Powershell and returns boolean it works. if it is VBS and returns strin or boolean it works. For the Userdeployment it all works find the global condition script works as planed. But we can not deploy an application with such a global contition to devices. As an Example when we follow exactly this: http://www.kraftkennedy.com/creating-global-conditions-in-configuration-manager-2012/ We can not deploy an ap with that condition to a devicecollection only usercollection work. From the comments we see that others semm to have the same Problem. Any Ideas? Regards Aspi .... I can't believe it works as designed. Opened a supportcase at MS if we can not find a solution here i will report MS supportcase results here SystemCenter Configuration Manager 2012 SP2 CU4
  4. Hi, the build in report "User device affinity associations per collection" doesn´t list the "OSD Defined" relationships. We are using powershell to import computers and set the UDA relationship with the following command: Invoke-WmiMethod -Namespace root/SMS/site_$($SiteCode) -Class SMS_UserMachineRelationship -Name CreateRelationship -ArgumentList @($WksResourceID, 6, 1, $User) -ComputerName $SiteServer The console shows the relationship and software deployment works well. If we change the parameter "source" from "6" (OSD Defined) to "2" (Administrator Defined) the report lists the relationship correctly. Any ideas? Best regards
  5. I need to clean up some old/outdated content and had a few questions on best practices. Right now I'm working on Software Updates and their Deployment Packages. Our normal monthly procedure creates a Software Update Group with required updates, as well as a Deployment Package. So for 2015, we have 12 Software Update Groups and 12 associated Deployment Packages. I'm currently rolling all of the 2015 updates into one Group and one Deployment Package, and need to remove not only all of the Deployment Packages, but I want to make sure that it also removes the content from the associated Distribution Points. What's the best practice way to do this? If I just delete the deployment packages from the console, will it remove the content? (I doubt it, since you can go into the Properties of the deployment packages and remove the content from the 'Content Locations' tab. But of course you can only remove them one at a time in the GUI and that would take WAY too long for 12 Deployment Packages that are on 13 distribution points.) the Remove-CMContentDistribution or Remove-CMSoftwareUpdateDeploymentPackage cmdlets seem promising, but we don't have a test environment, and I'm not yet a Powershell guru, so I want to make sure that I know what I'm doing before just trying them out in prod. Can anyone provide me with some -Examples of their proper usage (or a better powershell way to clean up outdated content from DPs)?
  6. Afternoon all, I am trying to setup a simple script that will determine if Drive E: exists and if so is it a CD Rom drive. Then based on that info run install command line. The if else logic seems to work but I'm having a hard time getting the install cmd to run. Any help would be greatly appreciated, I'm also open to other ways of doing this. Exit code btw is 1622. Cheers, Mike $instdir = Get-WmiObject -Class Win32_LogicalDisk | Where-Object {$_.DeviceID -eq "E:"} If (!($instdir)){ $process = start-process -filepath "setup.exe" -argumentlist '/s /v"/l*voicewarmup \"%temp%\besclientinstall.log\" INSTALLDIR=\"C:\Program Files (x86)\BigFix Enterprise\BES Client\" /qn"' -Wait -PassThru } ElseIf ($instdir.DriveType -eq "5"){ $process = start-process -filepath "setup.exe" -argumentlist '/s /v"/l*voicewarmup \"%temp%\besclientinstall.log\" INSTALLDIR=\"C:\Program Files (x86)\BigFix Enterprise\BES Client\" /qn"' -Wait -PassThru } Else { $process = start-process -filepath "setup.exe" -argumentlist '/s /v"/l*voicewarmup \"%temp%\besclientinstall.log\" INSTALLDIR=\"E:\Program Files (x86)\BigFix Enterprise\BES Client\" /qn"' -Wait -PassThru } $process.ExitCode
  7. I want to know if anyone has a script or tutorial on creating a script to "enable enterprise mode" and to allow enterprise mode to use a "website list" to manage certain sites. I know this should be fairly simple to do but I am new to scripting so I felt after several hours of looking and obviously creating the wrong searches, it time to ask the pros. Would prefer vbscript, but will not refuse powershell.
  8. Hello, I have sourced a powershell script which removes Windows 8.1 applications and the tile ( appx ) If I run the script manually on a client the script runs and removes the application tile from the metro screen. I have altered the script a few times to remove multiple application tiles at once and that worked fine as well. I have created a program in SCCM 2012 and deployed to a client. The EXECMGR log file tells me the script is received by the client and has run successfully, exit code = 0, the execution status is Success. But I can still see the tile on the metro screen and the app content in c:\program files\windows apps The script is as below - $AppsToDelete="*Microsoft.WindowsReadingList*" Foreach ($AppName in $AppsToDelete) { get-appxprovisionedpackage -online | where packagename -like $AppName | remove-appxprovisionedpackage -Online Get-AppxPackage -name $AppName -allusers | Remove-AppxPackage } The program used by SCCM2012 to execute the script is as follows - PowerShell.exe -ExecutionPolicy UnRestricted -File .\delappsreadinglistonly.ps1 Can anyone offer clues or pointers about what to do next ? My skills with Powershell are minimal ! Thanks...
  9. Hello, I found the script below on an old TechNet forum post. I'm curious about the variables being used. Are they ConfigMgr variables or something the poster created? If they are known variables in ConfigMgr where can I find these values? Is there a documented list somewhere? Start-CMSoftwareUpdateDeployment -CollectionName $CollectionName -DeploymentType $DeploymentIntent -DeploymentName $DeployMentName -DeploymentAvailableDay(Get-date) -DeploymentExpireTime (Get-Date) Thanks, Mike
  10. I'm trying to use a PowerShell script to verify the installation of an application deployment, but so far it hasn't worked well. I've never had any issues with the detection rules, but I'm quite new to SCCM, and this is the first time I'm using PowerShell to do it. The application is deployed to computers, it is installed for system, and whether the user is logged in or not (although I've been logged in for the most part I've attempted to solve this). The detection script works fine when run manually; it does some checks and then if it succeeds it runs Write-Host 'Installed', and as far as I've understood it, that's all it should take. I've tried a couple other things, like using return, just in case I misunderstood, but this doesn't seem to be the issue. I have tried to change the execution policy on the client computers. The value is stored in the HKLM so I assume it's not context related with regards to user, unless there's some special execution policy for SCCM. I have, just in case, tried to sign the detection method script as well, with no luck (I used open when fetching the script instead of pasting it in the text field, to be clear). The following error (currently) shows up even if I set execution policy to unrestricted, and regardless of whether the script is signed or not. It should be noted that I haven't had any issues with the installation script for the very same application, which is also a PowerShell script. AppIntent.log: <![LOG[ScopeId_54761859-29CE-43B8-9BEE-B88049CB81CB/DeploymentType_d02b19f5-fc3c-4474-a737-f60fc632dfb7/24 :- Current State = Error, Applicability = Unknown, ResolvedState = None, ConfigureState = NotNeeded, Title = MySoftware]LOG]!><time="10:01:30.360-120" date="09-24-2015" component="AppIntentEval" context="" type="1" thread="4068" file="appconstructs.cpp:2357"> <![LOG[ScopeId_54761859-29CE-43B8-9BEE-B88049CB81CB/Application_8aa515e3-1cb7-401d-8b54-8d80ea8253d9/37 :- Current State = Error, Applicability = Unknown, ResolvedState = None, ConfigureState = NotNeeded, Title = MySoftware]LOG]!><time="10:01:30.360-120" date="09-24-2015" component="AppIntentEval" context="" type="1" thread="4068" file="appconstructs.cpp:3057"> AppDiscovery.log: <![LOG[Entering ExecQueryAsync for query "select * from CCM_AppDeliveryType where (AppDeliveryTypeId = "ScopeId_54761859-29CE-43B8-9BEE-B88049CB81CB/DeploymentType_d02b19f5-fc3c-4474-a737-f60fc632dfb7" AND Revision = 25)"]LOG]!><time="10:04:09.403-120" date="09-24-2015" component="AppDiscovery" context="" type="1" thread="5060" file="appprovider.cpp:406"> <![LOG[ Performing detection of app deployment type MySoftware(ScopeId_54761859-29CE-43B8-9BEE-B88049CB81CB/DeploymentType_d02b19f5-fc3c-4474-a737-f60fc632dfb7, revision 25) for system.]LOG]!><time="10:04:09.406-120" date="09-24-2015" component="AppDiscovery" context="" type="1" thread="5060" file="appprovider.cpp:2148"> <![LOG[ In-line script returned error output: & : File C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3c51ada3.ps1 can not be loaded. The file C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3 c51ada3.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy , see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170 . At line:1 char:3 + & 'C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3c51ada3.ps1' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: ( [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess ]LOG]!><time="10:04:09.819-120" date="09-24-2015" component="AppDiscovery" context="" type="2" thread="5060" file="appexcnlib.cpp:1022"> <![LOG[Script Execution returned error message: & : File C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3c51ada3.ps1 can not be loaded. The file C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3 c51ada3.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy , see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170 . At line:1 char:3 + & 'C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3c51ada3.ps1' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: ( [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess , ExitCode: 1]LOG]!><time="10:04:09.819-120" date="09-24-2015" component="AppDiscovery" context="" type="2" thread="5060" file="scripthandler.cpp:473"> <![LOG[ Script Execution Returned :1, Error Message: & : File C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3c51ada3.ps1 can not be loaded. The file C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3 c51ada3.ps1 is not digitally signed. You cannot run this script on the current system. For more information about running scripts and setting execution policy , see about_Execution_Policies at http://go.microsoft.com/fwlink/?LinkID=135170 . At line:1 char:3 + & 'C:\Windows\CCM\SystemTemp\803c4b19-c156-4d0d-b65d-6d3e3c51ada3.ps1' + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : SecurityError: ( [], PSSecurityException + FullyQualifiedErrorId : UnauthorizedAccess . [AppDT Id: ScopeId_54761859-29CE-43B8-9BEE-B88049CB81CB/DeploymentType_d02b19f5-fc3c-4474-a737-f60fc632dfb7, Revision: 25]]LOG]!><time="10:04:09.820-120" date="09-24-2015" component="AppDiscovery" context="" type="3" thread="5060" file="scripthandler.cpp:506"> <![LOG[CScriptHandler::DiscoverApp failed (0x87d00327).]LOG]!><time="10:04:09.822-120" date="09-24-2015" component="AppDiscovery" context="" type="3" thread="5060" file="scripthandler.cpp:546"> <![LOG[Deployment type detection failed with error 0x87d00327.]LOG]!><time="10:04:09.822-120" date="09-24-2015" component="AppDiscovery" context="" type="3" thread="5060" file="appprovider.cpp:2203"> <![LOG[Failed to perform detection of app deployment type MySoftware(MySoftware, revision 25) for system. Error 0x87d00327]LOG]!><time="10:04:09.822-120" date="09-24-2015" component="AppDiscovery" context="" type="3" thread="5060" file="appprovider.cpp:545"> AppEnforce.log is currently void of any references to "MySoftware".
  11. Hi Guys, Does anyone have a HTA or powershell front end that i can use , or suggestions on how to use a current one out there, my requirements are pretty simple i think. We have about 100 different sites in 4 different countries, and we now name our computers with the following format OFFICE-Serial where office is a 7 digit identifier for the office, and serial is the last 7 digits of the serial number. Lets say i have the following. >England >>Manchester >>London >> South London >Scotland >>Inverness >>Edinburgh Names would be MANCHE-SERIAL STHLOND-SERIAL etc. I would like a drop down first to select the country, and then a drop down to select the site with results only from the country in question I would then need OSDComputer Name to prefix 7 digits of this name and then append "-" + serial number. Can anyone help me with this? i have this which is from technet and i have modified a bit, but dont know vb well enough to modify. <!--Script Settings <ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd"> <ScriptPackager> <process /> <arguments /> <extractdir>%TEMP%</extractdir> <files /> <usedefaulticon>true</usedefaulticon> <showinsystray>false</showinsystray> <altcreds>false</altcreds> <efs>true</efs> <ntfs>true</ntfs> <local>false</local> <abortonfail>true</abortonfail> <product /> <version>1.0.0.1</version> <versionstring /> <comments /> <company /> <includeinterpreter>false</includeinterpreter> <forcecomregistration>false</forcecomregistration> <consolemode>false</consolemode> <EnableChangelog>false</EnableChangelog> <AutoBackup>false</AutoBackup> <snapinforce>false</snapinforce> <snapinshowprogress>false</snapinshowprogress> <snapinautoadd>2</snapinautoadd> <snapinpermanentpath /> <cpumode>1</cpumode> <hidepsconsole>false</hidepsconsole> </ScriptPackager> </ScriptSettings> endregion--> <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html"> <meta content="text/html; charset=ISO-8859-1" http-equiv="content-type"> <title>Imaging Solutions v2.3</title> <HTA:APPLICATION ID="maging Solutions" APPLICATIONNAME="Imaging Solutions" BORDER="none" CAPTION="yes" CONTEXTMENU="no" ICON="icon.ico" INNERBORDER="no" NAVIGABLE="true" SCROLL="no" SCROLLFLAT="yes" SELECTION="no" SHOWINTASKBAR="yes" SINGLEINSTANCE="yes" SYSMENU="yes" TITLEBAR="no" VERSION="2.2"/> <script type="text/vbscript"> '******************************************************************************' ' Global Variables ' '******************************************************************************' dim varPanel varPanel = 1 dim logHTA logHTA = "\\cm1\source files\\" & strSerialNum & ".log" Dim oTSProgressUI Set oTSProgressUI = CreateObject("Microsoft.SMS.TSProgressUI") oTSProgressUI.CloseProgressDialog() Dim strComputer strComputer = "." Dim strSerialNum Dim strUser Dim oTSEnvironment Set oTSEnvironment = CreateObject("Microsoft.SMS.TSEnvironment") '******************************************************************************' ' Window Onload Event ' '******************************************************************************' Sub Window_OnLoad '******************************************************************************' ' ComputerName Field Default Value ' '******************************************************************************' Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" & strComputer & "\root\cimv2") Set colSMBIOS = objWMIService.ExecQuery("Select * from Win32_BIOS") For Each objSMBIOS in colSMBIOS strSerialNum = objSMBIOS.SerialNumber Next window.document.getElementById("ComputerName").value = strSerialNum End Sub '******************************************************************************' ' Size & Positioning ' '******************************************************************************' winWidth=800 winHeight=600 window.resizeto winWidth,winHeight centerX=(screen.width-winWidth)/2 centerY=(screen.height-winHeight)/2 window.moveto centerX,centerY posX=0 posY=0 move=0 '******************************************************************************' ' Function for Dragging Window ' '******************************************************************************' Function setPos() posX=window.event.screenX posY=window.event.ScreenY move=1 End Function Function moving() If move=1 Then moveX=0 moveY=0 moveX=window.event.screenX-posX moveY=window.event.screenY-posY window.moveto(window.screenLeft+moveX),(window.screenTop+moveY) setPos() End if End Function Function stopMoving() move=0 End Function '******************************************************************************' ' Function to Close HTA ' '******************************************************************************' Function closeHTA() self.close End Function '******************************************************************************' ' Validate Variables ' '******************************************************************************' Sub runValidation If varPanel = 1 Then If ComputerName.value = "" Then msgbox("Please Enter a Computer Name") ElseIf Username.value = "" Then msgbox("Please Enter a Username") Else runInstall End If ElseIf varPanel = 2 Then runRefresh ElseIf varPanel = 3 Then runBackup End If End Sub '******************************************************************************' ' Configure Task Sequence Variables ' '******************************************************************************' Sub runInstall 'msgbox("Test: " & varPanel)' '************************************************************' ' Image Version ' '************************************************************' If ImageChoice.value = "1" Then oTSEnvironment("swn_OSPicker") = "Win7EntSP1x64" 'msgbox("OSImage Picker: " & oTSEnvironment("swn_OSPicker"))' End If '************************************************************' ' Computer Name ' '************************************************************' oTSEnvironment("OSDComputerName") = computername.value 'msgbox("ComputerName TSValue: " & oTSEnvironment("OSDCOMPUTERNAME"))' '************************************************************' ' AD OU ' '************************************************************' If ADOU.value = "1" Then oTSEnvironment("swn_ADOU") = "laptops" 'msgbox("AD OU TSValue: " & oTSEnvironment("swn_ADOU"))' ElseIf ADOU.value = "2" Then oTSEnvironment("swn_ADOU") = "laptopsnouac" 'msgbox("AD OU TSValue: " & oTSEnvironment("swn_ADOU"))' ElseIf ADOU.value = "3" Then oTSEnvironment("swn_ADOU") = "desktops" 'msgbox("AD OU TSValue: " & oTSEnvironment("swn_ADOU"))' ElseIf ADOU.value = "4" Then oTSEnvironment("swn_ADOU") = "desktopsnouac" 'msgbox("AD OU TSValue: " & oTSEnvironment("swn_ADOU"))' ElseIf ADOU.value = "5" Then oTSEnvironment("swn_ADOU") = "vdiworkstations" 'msgbox("AD OU TSValue: " & oTSEnvironment("swn_ADOU"))' End If '************************************************************' ' Set Primary User ' '************************************************************' oTSEnvironment("SMSTSUdaUsers") = Username.value '************************************************************' ' Job Role Picker ' '************************************************************' ' For Each oJobRole in rJobRole' ' If oJobRole.Checked Then' ' oTSEnvironment("swn_JobRole") = oJobRole.value' ' msgbox("You slected " & oJobRole.value & ".")' ' End If' ' Next' '************************************************************' ' Applications - Non-Licensed ' '************************************************************' '************************************************************' ' Applications - Licensed ' '************************************************************' closeHTA() End Sub Sub runRefresh msgbox("Test" & varPanel) End Sub Sub runBackup msgbox("Test" & varPanel) End Sub '******************************************************************************' ' Dump Variables ' '******************************************************************************' Sub dumpvariables Set objFSO=CreateObject("Scripting.FileSystemObject") Set objFile = objFSO.OpenTextFile(logHTA,8,True) For each varTSVar in oTSEnvironment.GetVariables objFile.WriteLine varTSVar & " = " & oTSEnvironment(varTSVar) Next objFile.Close End Sub '******************************************************************************' ' Panel Browsing - Change page and set variables ' '******************************************************************************' Sub setPanel1 Panel(1) varPanel = 1 End Sub Sub setPanel2 Panel(2) varPanel = 2 End Sub Sub setPanel3 Panel(3) varPanel = 3 End Sub </script> <script type="text/javascript"> '******************************************************************************' ' Panel Switching ' '******************************************************************************' var panels = new Array("","panel1","panel2","panel3"); function panel(tab) { for (i=1; i<panels.length; i++) { if (i == tab) { document.getElementById("tab"+i).className = "tabs tabs1"; document.getElementById("panel"+i).style.display = "block"; } else { document.getElementById("tab"+i).className = "tabs tabs0"; document.getElementById("panel"+i).style.display = "none"; } } } </script> <style type="text/css"> /* Layout Styles - for designing the overall template */ html,body { margin:0; padding:5px; position:relative; } html { border: 2px solid #00A6DE; } #divheader { width:100%; height:50px; position: relative; } #divcontent { width: 100%; } #divtopnav { height: 33px; width: 100%; position: relative; } #divbody { min-height: 414px; height: 100%; width:100%; position: relative; } #divbottomnav { height: 29px; width: 100%; position: relative; } #divfooter { height:50px; width:100%; position: relative; } body,td,th,h1 { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 10px; } /* Logo Styles - for branding */ #logo1 { width: 112px; height: 49px; float: left; } #tagline { position: absolute; bottom: 0px; right: 0px; font-size: 16px; font-weight:600; float: right; } #logo2 { position: absolute; bottom: 0px; right: 0px; width: 87px; height: 43px; float: right; } /* Navigation Styles - for creating navigation bar */ #topnav { width: 100%; float: left; background-color: #f2f2f2; border-bottom: 1px solid #ccc; border-right: 1px solid #ccc; border-top: 1px solid #ccc; } #topnav ul { list-style: none; width: 100%; margin: 0 auto; padding: 0; } #topnav li { float: left; } #topnav li a { display: block; padding: 8px 15px; text-decoration: none; font-weight: bold; color: #003050; border-right: 1px solid #ccc; } #topnav li:first-child a { border-left: 1px solid #ccc; } #topnav li a:hover { color: #00A6DE; background-color: #fff; } #topnav li a:active { color: #00A6DE; background-color: #FFF; } /* ------------------------ */ #bottomnav { position: absolute; bottom: 0px; width: 100%; float: left; background-color: #F2F2F2; border-bottom: 1px solid #ccc; border-left: 1px solid #ccc; border-top: 1px solid #ccc; border-right: 1px solid #ccc; /* Remove this line if using more than one nav button */ } #bottomnav ul { list-style: none; width: 100%; margin: 0 auto; padding: 0; } #bottomnav li { float: right; } #bottomnav li a { display: block; padding: 6px 12px; text-decoration: none; font-weight: bold; color: #003050; border-left: 1px solid #ccc; } #bottomnav li:first-child a { border-right: 1px solid #ccc; } #bottomnav li a:hover { color: #FFF; background-color: #CCC; } /* Body Styles - for managing content in the body panels */ .bodypanel { height: 100%; padding: 0px; position: relative; width: 100%; z-index: 0; } #divbodysub { padding-top: 5px; } #divcontainer { width:773px; border: 1px solid #CCCCCC; float:left; padding: 0px; height: 105px; } #divcontainersplit { width:386px; border: 1px solid #CCCCCC; float:left; padding: 0px; height: 105px; } #divcontainersplit:first-child { border-right: 0px; } .divcontainersub { padding: 2px; } .containertitle { text-align:center; background-color: #F2F2F2; border-bottom: 1px solid #CCCCCC; } /* Input Styles - for changing the look of input fields */ .inputlabels { } .inputfields { font-family: "Trebuchet MS", Arial, Helvetica, sans-serif; font-size: 10px; border: 1px solid #00a6de; } .helpbutton { padding-left: 2px; } </style> </head> <body> <div class="pagewrap"> <div id="divheader" onmousedown="VBScript:Call setPos()" onmousemove="VBScript:Call moving()" onmouseup="VBScript:Call stopMoving()"> <div> <img id="logo1" src="images/logo/logo.png" /> </div> <div id="tagline"> Imaging Solutions v2.3 </div> </div> <!-- BEGIN Browsing Tabs --> <div id="divcontent"> <div id="divtopnav"> <div id="topnav"> <ul> <li id="tab1" onclick="setpanel1"><a href="#" tabindex="1002">Install</a></li> <li id="tab2" onclick="setpanel2"><a href="#" tabindex="1003">Refresh</a></li> <li id="tab3" onclick="setpanel3"><a href="#" tabindex="1004">Backup</a></li> </ul> </div> </div> <!-- END Browsing Tabs --> <!-- BEGIN Install Page --> <div id="divbody"> <div id="panel1" class="bodypanel" style="display:block;"> <div id="divbodysub"> Description: This page is for install-only scenarios of a specific OS. No backups or user data migration will occur on the machine. </div> <div id="divbodysub"> <label for="ImageName">Choose the OS Image:</label> <select id="ImageName" class="inputfields" tabindex="1" name="ImageChoice" size="1"> <option value="1">Win 7 Ent x64</option> </select><img class="helpbutton" src="images/help.png"images/Metrostation/MB_0011_info3_blue.png"" width="16" height="16" alt="Choose the image to use"> <script type="text/javascript">ImageName.focus();</script> </div> <div id="divbodysub" style="float:left"> <div id="divcontainersplit"> <div class="containertitle"> Computer Information </div> <div class="divcontainersub"> <label for="ComputerName">Computer Name:</label> <input id="ComputerName" class="inputfields" name="ComputerName" tabindex="2" type="text" size="57" maxlength="15" disabled="true"> </div> <div class="divcontainersub"> <label for="ADOU">Active Directory OU:</label> <select id="ADOU" class="inputfields" tabindex="3" name="ADOU" size="1" style="width:278px;"> <option value="1">Laptops</option> <option value="2">Desktops</option> <option value="3">Servers</option> </select> </div> <div id="divcontainersplit"> <div class="containertitle"> Locale </div> <div class="divcontainersub"> <label for="ADOU">Select Region:</label> <select id="ADOU" class="inputfields" tabindex="3" name="ADOU" size="1" style="width:278px;"> <option value="1">Scotland</option> <option value="2">Wales</option> <option value="3">Ireland</option> <option value="4">England</option> </select> </div> </div> <div id="divcontainersplit"> <div class="containertitle"> Locale </div> <div class="divcontainersub"> <label for="ADOU">Select Region:</label> <select id="ADOU" class="inputfields" tabindex="3" name="ADOU" size="1" style="width:278px;"> <option value="1">London</option> <option value="2">Manchester</option> </select> </div> </div> <div id="divcontainersplit"> <div class="containertitle"> User Information </div> <div class="divcontainersub"> <label for="Username">Domain\Username:</label> <input id="Username" class="inputfields" name="Username" tabindex="4" type="text" size="55"/> </div> <div class="divcontainersub"> <div> Job Role: </div> <div class="divcontainersub"> The username entered in the above field will determine what role based applications are installed based on the Job Role collection they are apart of.</li> </div> </div> </div> <div id="divbodysub"> <div id="divcontainer" > <div class="containertitle"> Applications - Non-Licensed </div> <div class="divcontainersub"> <!-- <input type="checkbox" name="7zip" value="7zip" tabindex="9">7-zip <input type="checkbox" name="iTunes" value="iTunes" tabindex="10">iTunes --> </div> </div> </div> <div id="divbodysub"> <div id="divcontainer" > <div class="containertitle"> Applications - Licensed </div> <div class="divcontainersub"> <!-- <input type="checkbox" name="AdobeAcro9Pro" value="AdobeAcro9Pro" tabindex="51">Adobe Acrobat v9 Pro <input type="checkbox" name="Cygnet8" value="Cygnet8" tabindex="52">Cygnet v8 --> </div> </div> </div> </div> </div> <!-- END Install Page --> <!-- BEGIN Refresh Page --> <div id="panel2" class="bodypanel" style="display:none;"> <div id="divbodysub"> Description: This page is for the reinstallation of an OS to a machine that has been previously imaged. This process gives some options for data backup. </div> <div id="divbodysub"> <label for="ImageName">Choose the OS Image:</label> <select id="ImageName" class="inputfields" tabindex="1" name="ImageName" size="1"> <option value="1">Win 7 Ent x64</option> <option value="2">Other</option> </select><img class="helpbutton" src="images/help.png" width="15" height="15" alt="Choose the image to use"> </div> </div> <!-- END Refresh Page --> <!-- BEGIN Backup Page --> <div id="panel3" class="bodypanel" style="display:none;"> Backup </div> </div> <!-- END Backup Page --> <div id="divbottomnav"> <div id="bottomnav"> <ul> <li onclick="close ()"><a href="#" tabindex="1001">Quit</a></li> <li onClick="runValidation"><a href="#" tabindex="1000">Run</a></li> </ul> </div> </div> </div> <div id="divfooter"> <div> <img id="logo2" src="images/logo/sublogo.png" /> </div> </div> </div> </body> </html>
  12. I am familiar with Powershell but find the CM2012 cmdlets to be quite lacking. Being as my WMI querying skills are not that strong, I am looking for help in writing a Powershell WMI query (or script, if necessary) to get a list of content on a distribution point group. I can see it in the GUI, so I know it's there. I just can't figure out how to get it into a manageable list text format. I would like it to contain the following fields: Name,Type,Size (MB),Package ID. Any help would be greatly appreciated.
  13. Hi WN im working on a script where i want to pass a param to the script. When I run it without any param it install the regedit changes. I want to use the same script for the clean up. like this: newdev.ps1 -uninstall then do this and this how do i get this to work?
  14. I am attempting to write a powershell script for our 2012 SP1 environment that well ask for the input of a package ID and it will prestage its dependencies all in separate pkgx files so it is easier to tell what has already been pre-staged. Each dependency will be named by package ID. I have the logic to get the dependencies, however I noticed something. If I go to prestage a file and check the box to include dependencies, it will list the superseded packages as well. If I try to distribute content, it will only list the dependencies. While researching superscedence and content issues, I have discovered that if it is deployed via Task Sequence, it will download the supersceded application as well. So this then changes the need for my script, I now need a way to determine what applications an application supersedes through a WMI or SQL query. Does anyone have any idea where to find that? I am attempting to find it in the DBprov log now, but I was hoping someone might have that info already available.
  15. Hi Friends, i have big problem i need to evaluate configuration baseline remotely not manual and it not working by ConfigMgr Console Extention tools as below
  16. m trying to write a powershell script that will remove the computer running it from sccm during a task sequence. I have the proper server and site name in but it always returns a null resID during the task sequence but when i change it to be used in a normal powershell script in the ise it works just fine. I have the computer name saved as a task sequence variable OSDComputerName earlier in the task sequence. Can anyone help me out? $SCCMServer = 'SERVER' $sitename = 'SITE' $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment $computername=$Tsenv.value("OSDComputerName") $resID = Get-WmiObject -computername $SCCMServer -credential $credential -query "select resourceID from sms_r_system where Name like `'$computername`'" -Namespace "root\sms\site_$sitename" if ($resID.ResourceId -eq $null) {$msgboxValue = "The PC does not exist in SCCM"} else { $comp = [wmi]"\\$SCCMServer\root\sms\site_$($sitename):sms_r_system.resourceID=$($resID.ResourceId)" $comp.psbase.delete() #// deletion successfull? if($?) {$msgboxValue = "Successfully deleted $computername"} else {$msgboxValue = "Could not delete $computername, error: $($error[0])"} } [void][system.Reflection.Assembly]::LoadWithPartialName('Microsoft.VisualBasic') [Microsoft.VisualBasic.Interaction]::msgbox($msgboxValue, 0, "Delete from SCCM Status")
  17. Hello Windows-noob community! I wonder if there's something you could help me with? The task: - Populate the "Manged By" attribute of a computer object during OSD What I have so far: - A custom page in my UDI Wizard as follows The managed by field has the OSDManagedBy task sequence variable populated for it - The PowerShell #Create OSD Task Sequence Environment Object $tsenv = New-Object -COMObject Microsoft.SMS.TSEnvironment #Get the ComputerDescription $strComputerDesc = $tsenv.Value("OSDComputerDesc") #Get the ManagedBy Name $strManagedBy = $tsenv.Value(“OSDManagedBy”) #Computer Name $strName = $env:computername #Set the Active Directory Object Properties Set-ADComputer "$strName" -ManagedBy "$strManagedBy" Now, when fill in the strName and strManagedBy variables manually in the script, it goes off without a hitch. But I have it running right after the "Install Software" step in my task sequence and hence, the reason I'm here - it's not working. Any tips?
  18. Morning All, Happy New Year, I trust you have all had a good one? I am wondering if anyone has any experience with utilising the new Powershell DSC stuff into SCCM, and which route people would recommend. The way I see it, we have two ways that we can manage client compliance: 1) Using 'Configuration Baselines'. that has a nice GUI and built in reporting. We can do advanced queries using powershell scripts for any custom components we need. 2) We create Powershell Manifests and use DSC. We could then use task sequnces, packages/applications to actually deploy them and enforce. I imagine monitoring these could be a little more complex (custom report, mof files etc) Thanks, Paul
  19. I've written a blog article on how to do this using Powershell - no reboot is required once you've deployed this app, it's quick and instant. It also accepts a parameter for the cache size so that you can now have a single application with multiple deployment types - eg a cache size of 8GB for the majority of computers and another deployment type of 10GB if the computer has a a particular CAD program installed etc. You can also use this post to learn how to deploy Powershell scripts in general, and also, how to deploy powershell scripts that take parameters by studying the script I wrote (It's very simple) Here's the link
  20. Hi All, I've been having some issues executing powershell scripts using the status filter rules. I am able to run VB scripts without issue, but powershell scripts do not seem to execute. I have a VBscript that runs under the same conditions which executes without issue. The PS script is a basic script to send an email to the SCCM administrators upon successful completion of a task sequence. It will work perfectly when run manually, under both administrator and system accounts context. Powershell Execution Policy is set to unrestricted. The command line for the script is 'powershell -file \\SCCM\d$\packages\scripts\complete.ps1 %msgsys' I have also tried directly pointing to D:\Packages\...etc. Any ideas?
  21. One of the things we have implemented with our in-place refresh is re-installing printers with a powershell script...yes, I know there are ways to do this with GPO...I'm not going into the details, but suffice to say that GPO printer installs are not an option right now (unfortunately). But here's what I have run into...in my powershell, I'm executing the rundll32 printui.dll command. The script loops through and collects info on the printers which were installed and then choses the appropriate printer from that list to set as default, again using the rundll32 printui command. I have to use the rundll32 method because the prnmngr.vbs requires elevation to install a printer, which I can't get through a TS (at least not easily). If I simply run the script by itself then things work perfectly...all printers install and the default is set at the end. However, when running it from a TS, the only thing which doesn't work is setting the default printer. Since it wasn't working in my PS TS step, I figured I would hard-code it in with a Run Command Line step, passing a TS variable in my PS code. That didn't work either. I even setup a VBScript to set the default printer, but that did not work. I'm out of ideas at this point, and I don't know why it wouldn't be working from a TS other than it might be because it is running under a system context instead of a user? I don't know...I'm just stumped right now, and I'm too close to the project right now to think outside of the box at the moment. Any input would be appreciated. thanks.
  22. I'm wondering if any of you guys have experience installing the Salesforce for Outlook plugin. I'm using a Powershell script to install everything, it goes great until it gets to the actual SF Outlook plugin .msi file, then the software center says it installed correctly, but nothing installed. I have no shortcuts, no files in the directories, nothing - though software center says all went well. Anyone have any clues?
  23. I work for a university that has a standard DNS suffix that matches the domain name across most of the University. My department, however, is unique and our workstations are actually assigned a different DNS suffix that does not match the domain name. So a computer may be named CompName.DomainName.edu but it will resolve as CompName.AltDNSSuffix.edu. Central IT has given out department's IT delegated access to our department's device collection in Configuration Manager 2012 and sent us to training. One of the suggestions of our trainer was to utilize Now Micro Right Click Tools. These tools work for every department in the university but mine. Any time I try to use them, I get told that the workstation is offline. I believe the reason for this is my department's unique DNS Suffix. The actual error I get is "CompName.DomainName.edu is not online." The problem is that CompName.DomainName.edu does not resolve, only CompName.AltDNSSuffix.edu will resolve. I do not have control over the DNS or DHCP so I am looking for a solution that does not involve changes to their configuration. Now Micro Right Click tools is really just a cool collection of Powershell scripts so I believe I can correct this if I can get the script which queries and assigns the computer name to a variable to assign only the first part of the computer name, not the FQDN to the variable. Meaning the variable $CompName becomes "CompName" and not "CompName.DomainName.edu". I am not that skilled with Powershell or scripting in general and would appreciate any assistance. I believe the script I will paste at the bottom of this post is the one that needs to be altered. Thanks! Ryan <# Functions that do all the work Author: Ryan Ephgrave Now Micro Right Click Tools #> $ErrorActionPreference = "SilentlyContinue" $Script:JobTimer = @{} $Script:SkippedJobs = @() $Script:TimedOutComps = New-Object System.Collections.Arraylist $Script:UnsuccessfulCount = 0 $Script:NumSuccessful = 0 $Script:SuccessfulArray = New-Object System.Collections.Arraylist $Script:UnsuccessfulArray = New-Object System.Collections.Arraylist Function WOL { Param ( $CompName, $MAC, $IP, $SubnetMask, $Port, $PacketsToSend ) $UDPclient = New-Object System.Net.Sockets.UdpClient filter Convert-IPToDecimal{([iPAddress][string]([iPAddress]$_)).Address} filter Convert-DecimalToIP{([system.Net.IPAddress]$_).IPAddressToString} $PacketSentCount = 0 $SentPacket = $false $IPArray = $IP.Split(",") $MaskArray = $SubnetMask.Split(",") foreach ($instance in $IPArray){ if ($instance.contains(".")){ foreach ($MaskInstance in $MaskArray){ if ($MaskInstance.contains(".")){ $Error.Clear() $strEditedMac = $MAC | Out-String $strEditedMac = $strEditedMac.replace(":","") $strEditedMac = $strEditedMac.Substring(0,12) [uInt32]$ip = $instance | Convert-IPToDecimal [uInt32]$subnet = $MaskInstance | Convert-IPToDecimal [uInt32]$broadcast = $ip -band $subnet $broadcastAddr = $broadcast -bor -bnot $subnet | Convert-DecimalToIP $BroadcastAddress = [Net.IPAddress]::Parse($BroadcastAddr) $MakingPacket=0,2,4,6,8,10 | % {[Convert]::ToByte($strEditedMac.substring($_,2),16)} $Packet = (,[byte]255 * 6) + ($MakingPacket * 16) $UDPclient.Connect($BroadcastAddress,$Port) Do { [void]$UDPclient.Send($Packet, 102) $PacketSentCount++ } while ($PacketSentCount -lt $PacketsToSend) $SentPacket = $true $Results = Select-Object -InputObject "" One, Two, Three, Four, Five $Results.One = "$CompName" $Results.Two = "$MAC" $Results.Three = "$Instance" $Results.Four = "$MaskInstance" $Results.Five = "$Port" $Script:SuccessfulArray += $Results } } } } if ($SentPacket -eq $false) { $Results = Select-Object -InputObject "" One $Results.One = "$CompName" $Script:UnsuccessfulArray += $Results } $SentPacket } $Client_Actions = { $CompName = $args[0] $strAction = $args[1] $Answer = $args[2] If (Test-Connection -computername $CompName -count 1 -quiet){ if ($Answer -eq 6) { $ActionObject = Get-WmiObject -Query "Select * from InventoryActionStatus where InventoryActionID = '$strAction'" -Namespace root\ccm\invagt -ComputerName $CompName $ActionObject | Remove-WmiObject } $Error.Clear() $WMIPath = "\\" + $CompName + "\root\ccm:SMS_Client" $SMSwmi = [wmiclass] $WMIPath [Void]$SMSwmi.TriggerSchedule($strAction) if($Error[0]){$strOutput = "$CompName" + "|Error|" + $Error} else{$strOutput = "$CompName" + "|Successful"} } else {$strOutput = "$CompName" + "|Off"} Write-Output $strOutput } $Ping_Computer = { $CompName = $args[0] $strOutput = "$CompName|Left|" Test-connection -computername $CompName -count 1 | ForEach-Object { $StrOutput = $strOutput + $_.ProtocolAddress $StrOutput = $strOutput + "|" + $_.ResponseTime + "ms" $StrOutput = $strOutput + "|" + $_.ReplySize $StrOutput = $strOutput + "|" + $_.ResponseTimeToLive + "|" } if ($Error[0]) {$strOutput = "$CompName|Right|Off"} Write-Output $strOutput } $GPUpdate_Computer = { $CompName = $args[0] $UserPolicy = $args[1] $ComputerPolicy = $args[2] $Error.Clear() if ($UserPolicy -eq "True" -and $ComputerPolicy -eq "True") {$strCommand = "cmd /c echo N | gpupdate /force"} elseif ($UserPolicy -eq "True") {$strCommand = "cmd /c echo N | gpupdate /Target:User /force"} elseif ($ComputerPolicy -eq "True") {$strCommand = "cmd /c echo N | gpupdate /Target:Computer /force"} else {$strCommand = "cmd /c echo N | gpupdate /force"} if (Test-Connection $CompName -Count 1) { if ($UserPolicy -eq "True") { $LoggedOnUser = $null $strQuery = "Select UserName from Win32_ComputerSystem" Get-WmiObject -Query $strQuery -ComputerName $CompName | ForEach-Object {$LoggedOnUser = $_.UserName} if ($LoggedOnUser.Length -lt 1) { $strQuery = "Select * from Win32_Process where Name like 'explorer.exe'" Get-WmiObject -Query $strQuery -ComputerName $CompName | ForEach-Object {$LoggedOnUser = $_.GetOwner()} $LoggedOnUser = $LoggedOnUser.Domain + "\" + $LoggedOnUser.User } $LoggedOnUser = $LoggedOnUser | Out-String $LoggedOnUser = $LoggedOnUser.replace("`n","") if ($LoggedOnUser.Length -gt 2) { $Today = Get-Date $Tomorrow = $Today.AddDays(1) $Today = "{0:MM/dd/yyyy}" -f [DateTime]$Today $Tomorrow = "{0:MM/dd/yyyy}" -f [DateTime]$Tomorrow & cmd /c schtasks.exe /create /S "$CompName" /RU "$LoggedOnUser" /SC DAILY /SD "$Today" /ST "00:02" /ED "$Tomorrow" /Z /F /TN "Temp_GPUpdate_Task" /TR "`"$strCommand`"" Start-Sleep 10 & cmd /c schtasks.exe /run /S "$CompName" /i /tn "Temp_GPUpdate_Task" & cmd /c schtasks.exe /delete /S "$CompName" /f /tn "Temp_GPUpdate_Task" if ($Error[0]) { $ErrorMsg = $Error[0].Exception.Message $strOutput = "$CompName|Error|$ErrorMsg" } else {$strOutput = "$CompName|Successful|$LoggedOnUser"} } else { [WMIClass]$wmi = "\\$CompName\root\cimv2:Win32_Process" $wmi.Create($strCommand) | Out-Null if ($Error[0]) { $ErrorMsg = $Error[0].Exception.Message $strOutput = "$CompName|Error|$ErrorMsg" } else {$strOutput = "$CompName|Successful"} } } else { [WMIClass]$wmi = "\\$CompName\root\cimv2:Win32_Process" $wmi.Create($strCommand) | Out-Null if ($Error[0]) { $ErrorMsg = $Error[0].Exception.Message $strOutput = "$CompName|Error|$ErrorMsg" } else {$strOutput = "$CompName|Successful"} } } else {$strOutput = "$CompName|Off"} Write-Output $strOutput } $Cancel_Pending_Reboot = { $CompName = $args[0] If (test-connection -computername $CompName -count 1 -quiet){ $Error.Clear() & shutdown.exe /m $CompName /a $ShutdownExitCode = $LastExitCode if ($ShutdownExitCode -eq 1116) {$strOutput = "$CompName" + "|No pending shutdown"} elseif ($ShutdownExitCode -eq 0) {$strOutput = "$CompName" + "|Cancelled pending shutdown"} else {$strOutput = "$CompName" + "|Error|" + $Error} } else {$strOutput = "$CompName|Off"} Write-Output $strOutput } $Change_Cache_Size = { $CompName = $args[0] $NewCacheSize = $args[1] If (test-connection -computername $CompName -count 1 -quiet){ $Error.Clear() $CacheUsed = 0 $strQuery = "select ContentSize from CacheInfoEx" Get-WmiObject -ComputerName $CompName -Query $strQuery -Namespace root\ccm\SoftMgmtAgent | ForEach-Object { if ($_.ContentSize -ne $null) { $TempNum = 0 $TempNum = $_.ContentSize $TempNum = $TempNum / 1024 $CacheUsed = $CacheUsed + $TempNum } } $cachesize = Get-WmiObject -ComputerName $CompName -Class CacheConfig -Namespace root\ccm\softmgmtagent foreach ($instance in $cachesize) {$OldCache = $instance.Size} $Error.Clear() $cachesize.Size = "$NewCacheSize" $cachesize.Put() | Out-Null if($Error[0]){$strOutput = $CompName + "|Error|" + $Error} else{$strOutput = $CompName + "|Successful|" + $NewCacheSize + "|" + $OldCache + "|" + $CacheUsed} } else {$strOutput = "$Compname|Off"} Write-Output $strOutput } $Clear_Cache = { $CompName = $null $CompName = $args[0] If (test-connection -computername $CompName -count 1 -quiet){ $Error.Clear() Get-WmiObject -ComputerName $CompName -Class CacheInfoEx -Namespace root\ccm\softmgmtagent | ForEach-Object { $CachePath = $_.Location $CachePath = $CachePath.replace(":","$") $CachePath = "\\$CompName\$CachePath" Remove-Item $CachePath -Recurse -Force $_ | Remove-WmiObject } if ($Error[0]) {$strOutput = "$CompName" + "|Error| " + $Error} else {$strOutput = "$CompName" + "|Successful"} } else {$strOutput = "$CompName" + "|Off"} Write-Output $strOutput } $Repair_Client = { $CompName = $null $CompName = $args[0] If (test-connection -computername $CompName -count 1 -quiet){ $Error.Clear() $WMIPath = "\\" + $CompName + "\root\ccm:SMS_Client" $SMSwmi = [wmiclass] $WMIPath [Void]$SMSwmi.RepairClient() if ($Error[0]) {$strOutput = "$CompName" + "|Error|" + $Error} else {$strOutput = "$CompName" + "|Successful"} } else {$strOutput = "$CompName" + "|Off"} Write-Output $strOutput } $Restart_SMS_Service = { $CompName = $null $CompName = $args[0] If (test-connection -computername $CompName -count 1 -quiet){ $Error.Clear() $CcmExecService = Get-Service -ComputerName $CompName -Name "CcmExec" Restart-Service -InputObject $CcmExecService if ($Error[0]) {$strOutput = "$CompName" + "|Error| " + $Error} else {$strOutput = "$CompName" + "|Successful"} } else {$strOutput = "$CompName" + "|Off"} Write-Output $strOutput } $Uninstall_Client = { $CompName = $null $CompName = $args[0] If (test-connection -computername $CompName -count 1 -quiet){ $Error.Clear() Get-WmiObject -ComputerName $CompName -Class CCM_InstalledProduct -Namespace root\ccm | ForEach-Object {$ProductCode = $_.ProductCode} $UninstallCommand = "msiexec /x `"$ProductCode`" REBOOT=ReallySuppress /q" $WMIPath = "\\" + $CompName + "\root\cimv2:Win32_Process" $StartProcess = [wmiclass] $WMIPath $ProcError = $StartProcess.Create($UninstallCommand,$null,$null) $ProcError = $ProcError.ReturnValue if ($Error[0]) {$strOutput = "$CompName" + "|Error| " + $Error} else { if ($ProcError -eq 0){$strOutput = "$CompName" + "|Successful"} else {$strOutput = "$CompName" + "|Error| " + $Error} } } else {$strOutput = "$CompName" + "|Off"} Write-Output $strOutput } $Schedule_ShutdownRestart = { $CompName = $null $CompName = $args[0] $Action = $args[1] $Delay = $args[2] $IfUserOnBoxText = $args[3] $TaskName = $args[4] $FreqText = $args[5] $Modifier = $args[6] $StartDate = $args[7] $StartTime = $args[8] $EndDate = $args[9] $Directory = $args[10] $StartDay = $args[11] If (test-connection -computername $CompName -count 1 -quiet){ $Error.Clear() if ($Action -eq "Restart"){ if ($IfUserOnBoxText -eq "Restart/Shutdown") { $ShutdownCommand = "shutdown /r /f /t $delay" } elseif ($IfUserOnBoxText -eq "Give user a prompt to cancel"){ Get-WmiObject -ComputerName $CompName -class Win32_OperatingSystem | ForEach-Object {$WinDirectory = $_.WindowsDirectory} $ShutdownCommand = "$WinDirectory\ConfigMgr_Shutdown_Utility.exe /r /t $Delay /Schtask `"$WinDirectory\ConfigMgr_Shutdown_Utility.exe`"" $CopyDirectory = $WinDirectory.ToLower().replace("c:","\\$CompName\c$") Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.exe" $CopyDirectory -Force Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.vbs" $CopyDirectory -Force } elseif ($IfUserOnBoxText -eq "Cancel Restart/Shutdown") { Get-WmiObject -ComputerName $CompName -class Win32_OperatingSystem | ForEach-Object {$WinDirectory = $_.WindowsDirectory} $ShutdownCommand = "$WinDirectory\ConfigMgr_Shutdown_Utility.exe /r /t $Delay /Skip /Schtask `"$WinDirectory\ConfigMgr_Shutdown_Utility.exe`"" $CopyDirectory = $WinDirectory.ToLower().replace("c:","\\$CompName\c$") Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.exe" $CopyDirectory -Force } } elseif ($Action -eq "Shutdown") { if ($IfUserOnBoxText -eq "Restart/Shutdown") { $ShutdownCommand = "shutdown /s /f /t $delay" } elseif ($IfUserOnBoxText -eq "Give user a prompt to cancel"){ Get-WmiObject -ComputerName $CompName -class Win32_OperatingSystem | ForEach-Object {$WinDirectory = $_.WindowsDirectory} $ShutdownCommand = "$WinDirectory\ConfigMgr_Shutdown_Utility.exe -arguments /s /t $Delay /Schtask `"$WinDirectory\ConfigMgr_Shutdown_Utility.exe`"" $CopyDirectory = $WinDirectory.ToLower().replace("c:","\\$CompName\c$") Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.exe" $CopyDirectory -Force Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.vbs" $CopyDirectory -Force } elseif ($IfUserOnBoxText -eq "Cancel Restart/Shutdown") { Get-WmiObject -ComputerName $CompName -class Win32_OperatingSystem | ForEach-Object {$WinDirectory = $_.WindowsDirectory} $ShutdownCommand = "$WinDirectory\ConfigMgr_Shutdown_Utility.exe -arguments /s /t $Delay /Skip /Schtask `"$WinDirectory\ConfigMgr_Shutdown_Utility.exe`"" $CopyDirectory = $WinDirectory.ToLower().replace("c:","\\$CompName\c$") Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.exe" $CopyDirectory -Force } } if ($Error[0]) {$strOutput = "$CompName" + "|Error| " + $Error} else { if ($FreqText -eq "Once") { $Error.Clear() $strTest = & schtasks.exe /create /S "$CompName" /RU SYSTEM /SC ONCE /SD "$StartDate" /ST "$StartTime" /F /TN "$TaskName" /TR "`"$ShutdownCommand`"" if ($Error[0]) {$strOutput = "$CompName" + "|Error| " + $Error} else {$strOutput = "$CompName" + "|Successful"} } elseif ($FreqText -eq "Daily") { $Error.Clear() $strTest = & schtasks.exe /create /S "$CompName" /RU SYSTEM /SC DAILY /SD "$StartDate" /ST "$StartTime" /ED "$EndDate" /Z /F /TN "$TaskName" /TR "`"$ShutdownCommand`"" if ($Error[0]) {$strOutput = "$CompName" + "|Error| " + $Error} else {$strOutput = "$CompName" + "|Successful"} } elseif ($FreqText -eq "Weekly") { $Error.Clear() $strTest = & schtasks.exe /create /S "$CompName" /RU SYSTEM /SC WEEKLY /d "$StartDay" /SD "$StartDate" /ST "$StartTime" /ED "$EndDate" /Z /F /TN "$TaskName" /TR "`"$ShutdownCommand`"" if ($Error[0]) {$strOutput = "$CompName" + "|Error|$Error"} else {$strOutput = "$CompName" + "|Successful"} } elseif ($FreqText -eq "Monthly (On Day)") { $Error.Clear() if ($Modifier -eq "LASTDAY") {$strTest = & schtasks.exe /create /S "$CompName" /RU SYSTEM /SC MONTHLY /MO $Modifier /M * /SD "$StartDate" /ST "$StartTime" /ED "$EndDate" /Z /F /TN "$TaskName" /TR "`"$ShutdownCommand`""} else {$strTest = & schtasks.exe /create /S "$CompName" /RU SYSTEM /SC MONTHLY /MO $Modifier /d $StartDay /SD "$StartDate" /ST "$StartTime" /ED "$EndDate" /Z /F /TN "$TaskName" /TR "`"$ShutdownCommand`""} if ($Error[0]) {$strOutput = "$CompName" + "|Error| " + $Error} else {$strOutput = "$CompName" + "|Successful"} } elseif ($FreqText -eq "Monthly (On Date)") { $Error.Clear() $strTest = & schtasks.exe /create /S "$CompName" /RU SYSTEM /SC MONTHLY /d $StartDay /SD "$StartDate" /ST "$StartTime" /ED "$EndDate" /Z /F /TN "$TaskName" /TR "`"$ShutdownCommand`"" if ($Error[0]) {$strOutput = "$CompName" + "|Error| " + $Error} else {$strOutput = "$CompName" + "|Successful"} } } } else {$strOutput = "$CompName" + "|Off"} Write-Output $strOutput } $ShutdownRestart_Device = { $CompName = $args[0] $strAction = $args[1] $IndexNum = $args[2] $Delay = $args[3] $msg = $args[4] $Directory = $args[5] $psexec = $args[6] $LoggedOnUser = $null $LoggedOnDomain = $null If (test-connection $CompName -count 1 -quiet){ $Error.Clear() if ($strAction -eq "Restart"){ if ($IndexNum -eq 0){ & shutdown.exe /r /f /t $Delay /d p:0:0 /m $CompName /c $msg if ($Error[0]){ $ErrorMsg = $Error[0] $strOutput = $CompName + "|Error|" + $ErrorMsg } else {$strOutput = $CompName + "|Successful|" + $strAction} } elseif ($IndexNum -eq 1){ Get-WmiObject -ComputerName $CompName -class Win32_OperatingSystem | ForEach-Object {$WinDirectory = $_.WindowsDirectory} $CopyDirectory = $WinDirectory.ToLower().replace("c:","\\$CompName\c$") Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.exe" $CopyDirectory -Force Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.vbs" $CopyDirectory -Force $strQuery = "Select * from Win32_Process where Name='explorer.exe'" $SentShutdown = $false Get-WmiObject -ComputerName $CompName -Query $strQuery | ForEach-Object{ if ($_.Name -ne $null){ $SessionID = $_.SessionID $LoggedOnUser = $_.GetOwner().User $LoggedOnDomain = $_.GetOwner().Domain $LoggedOn = "$LoggedOnDomain" + "\" + "$LoggedOnUser" if (!($Error[0])) {$ClearError = $true} & $psexec "\\$CompName" /d /s /i $SessionID wscript.exe "$WinDirectory\ConfigMgr_Shutdown_Utility.vbs" "$WinDirectory\ConfigMgr_Shutdown_Utility.exe" /r /t $Delay /msg "`"$msg`"" | Out-Null if ($ClearError -eq $true) {$Error.Clear()} $SentShutdown = $true $strOutput = $Compname + "|Successful|Gave $LoggedOn a prompt to cancel $strAction" } } if ($SentShutdown -eq $false) { & shutdown.exe /r /f /t $Delay /d p:0:0 /m $CompName /c $msg $strOutput = $CompName + "|Successful|" + "$strAction" } if ($Error[0]) {$strOutput = $CompName + "|Error|" + $Error} } elseif ($IndexNum -eq 2){ $skip = 0 $strQuery = "Select * from Win32_Process where Name='explorer.exe'" Get-WmiObject -ComputerName $CompName -query $strQuery | ForEach-Object{ if ($_.Name -ne $null){ $skip = 1 $LoggedOnUser = $_.GetOwner().User $LoggedOnDomain = $_.GetOwner().Domain $LoggedOn = "$LoggedOnDomain" + "\" + "$LoggedOnUser" $strOutput = $CompName + "|Successful|Skipped - $LoggedOn" } } if ($skip -eq 0){ $Error.Clear() & shutdown.exe /r /f /t $Delay /d p:0:0 /m $CompName /c $msg if ($Error[0]){ $ErrorMsg = $Error[0] $strOutput = $CompName + "|Error|" + $ErrorMsg } else {$strOutput = $CompName + "|Successful|" + "$strAction"} } } } elseif ($strAction -eq "Shutdown"){ if ($IndexNum -eq 0){ & shutdown.exe /s /f /t $Delay /d p:0:0 /m $CompName /c $msg if ($Error[0]){ $ErrorMsg = $Error[0] $strOutput = $CompName + "|Error|" + $ErrorMsg } else {$strOutput = $CompName + "|Successful|" + "$strAction"} } elseif ($IndexNum -eq 1){ Get-WmiObject -ComputerName $CompName -class Win32_OperatingSystem | ForEach-Object {$WinDirectory = $_.WindowsDirectory} $CopyDirectory = $WinDirectory.ToLower().replace("c:","\\$CompName\c$") Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.exe" $CopyDirectory -Force Copy-Item "$Directory\ConfigMgr_Shutdown_Utility.vbs" $CopyDirectory -Force $strQuery = "Select * from Win32_Process where Name='explorer.exe'" $SentShutdown = $false Get-WmiObject -ComputerName $CompName -Query $strQuery | ForEach-Object{ if ($_.Name -ne $null){ $SessionID = $_.SessionID $LoggedOnUser = $_.GetOwner().User $LoggedOnDomain = $_.GetOwner().Domain $LoggedOn = "$LoggedOnDomain" + "\" + "$LoggedOnUser" if (!($Error[0])) {$ClearError = $true} & $psexec "\\$CompName" /d /s /i $SessionID wscript.exe "$WinDirectory\ConfigMgr_Shutdown_Utility.vbs" "$WinDirectory\ConfigMgr_Shutdown_Utility.exe" /s /t $Delay /msg "`"$msg`"" | Out-Null if ($ClearError -eq $true) {$Error.Clear()} $SentShutdown = $true $strOutput = $Compname + "|Successful|Gave $LoggedOn a prompt to cancel $strAction" } } if ($SentShutdown -eq $false) { & shutdown.exe /s /f /t $Delay /d p:0:0 /m $CompName /c $msg $strOutput = $CompName + "|Successful|" + "$strAction" } if ($Error[0]) {$strOutput = $CompName + "|Error|" + $Error[0]} } elseif ($IndexNum -eq 2){ $skip = 0 $strQuery = "Select * from Win32_Process where Name='explorer.exe'" Get-WmiObject -ComputerName $CompName -query $strQuery | ForEach-Object{ if ($_.Name -ne $null){ $skip = 1 $LoggedOnUser = $_.GetOwner().User $LoggedOnDomain = $_.GetOwner().Domain $LoggedOn = "$LoggedOnDomain" + "\" + "$LoggedOnUser" $strOutput = "$CompName" + "|Successful|Skipped - $LoggedOn" } } if ($skip -eq 0){ $Error.Clear() & shutdown.exe /s /f /t $Delay /d p:0:0 /m $CompName /c $msg if ($Error[0]){ $ErrorMsg = $Error[0] $strOutput = $CompName + "|Error|" + $ErrorMsg } else {$strOutput = $CompName + "|Successful|" + "$strAction"} } } } } else {$strOutput = "$CompName |Off"} Write-Output $strOutput } $Rerun_Deployment = { $CompName = $null $CompName = $args[0] $AdvID = $args[1] If (test-connection -computername $CompName -count 1 -quiet){ $Error.Clear() $strQuery = "Select * from CCM_Scheduler_ScheduledMessage where ScheduledMessageID like '" + $AdvID + "%'" $objSMSSchID = Get-WmiObject -Query $strQuery -Namespace root\ccm\policy\machine\actualconfig -computername $CompName foreach($instance in $objSMSSchID){$strScheduleID = $instance.ScheduledMessageID} if ($Error[0]){$strOutput = "$CompName" + "|Error| " + $Error} else { $strQuery = "Select * from CCM_SoftwareDistribution where ADV_AdvertisementID='" + $AdvID + "'" Get-WmiObject -ComputerName $CompName -Namespace "root\CCM\Policy\Machine\ActualConfig" -Query $strQuery | ForEach-Object { $_.ADV_MandatoryAssignments = "True" $_.ADV_RepeatRunBehavior = "RerunAlways" [Void]$_.Put() } $WMIPath = "\\" + $CompName + "\root\ccm:SMS_Client" $SMSwmi = [wmiclass] $WMIPath [Void]$SMSwmi.TriggerSchedule($strScheduleID) if ($Error[0]){$strOutput = "$CompName" + "|Error| " + $Error} else {$strOutput = "$CompName" + "|Successful"} } } else {$strOutput = "$CompName" + "|Off"} Write-Output $strOutput } $CcmEval = { $CompName = $null $CompName = $args[0] $CcmEvalPath = $null If(Test-Connection $CompName -Count 1) { Get-WmiObject -ComputerName $CompName -Class Win32_OperatingSystem | ForEach-Object {$WindowsDirectory = $_.WindowsDirectory} $WindowsDirectory = $WindowsDirectory.replace(":","$") $WindowsDirectory = "\\$CompName\$WindowsDirectory" $TestPath1 = $WindowsDirectory + "\CCM\CcmEval.exe" $TestPath2 = $WindowsDirectory + "\System32\CCM\CcmEval.exe" $TestPath3 = $WindowsDirectory + "\syswow64\CCM\CcmEval.exe" if (Test-Path $TestPath1){$CCMEvalPath = $TestPath1} elseif (Test-Path $TestPath2){$CCMEvalPath = $TestPath2} elseif (Test-Path $TestPath3){$CCMEvalPath = $TestPath3} if ($CcmEvalPath -ne $null) { $Error.Clear() ([WMIClass]"\\$CompName\root\CIMV2:Win32_Process").Create($CcmEvalPath) | Out-Null if ($Error[0]) {$strOutput = "$CompName" + "|Error|" + "$Error"} else {$strOutput = "$CompName" + "|Successful"} } else {$strOutput = "$CompName" + "|Error|" + "$Error"} } else {$strOutput = "$CompName" + "|Off"} Write-Output $strOutput } #>
  24. I have written a series on the PowerShell Deployment Toolkit (PDT). However, recently there has been a new addition of a GUI element. Check out the PDT GUI article on my blog here: http://adinermie.wordpress.com/2014/06/14/my-experience-with-the-powershell-deployment-toolkit-pdt-part-4-pdt-gui-for-powershell-deployment-toolkit/ Or check out the beginning of the series here: http://adinermie.wordpress.com/2014/01/26/my-experience-with-the-powershell-deployment-toolkit-pdt-part-1-downloader-ps1/
  25. I'm trying to create a task sequence step that installed the SNMP service for a 2008 R2 server and I cannot get it to work. I have tried several things I have found out on the internet, from create a package with several different command lines to just running a command line task step and none have worked. The last thing I tried was running the following command line in a Program: powershell.exe get-content '.\2008InstallSNMPService.ps1' | powershell.exe -noprofile - The ps1 file contains the following, which works when an OS is booted: import-module servermanager add-windowsfeature snmp-service Can anyone help me get this figured out? TIA
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.