Quick and Dirty Management Point check

If you have a big Configuration Manager environment and you don´t have a monitoring solution like SCOM or NAGIOS, then PowerShell can help you too.  This script queries all Management Points from SMS_SystemResourceList WMI class and it will check MPCERT and MPLIST website status. If you want to use this script then run it on your Central, CAS or Primary Site Server like this: Get-CMSMPStatus.ps1 -SiteCode PS1 -SiteServer Localhost -OutPut c:\Temp\MPStatus.csv. This will create a CSV Report (example below) This script should work with PSH v2 and v3. You can download the code example from here

By |2013-01-29T14:20:44+01:00januar 29th, 2013|Configuration Manager (SCCM), Powershell|2 Comments

Set-SCOMLicense : Requested registry access is not allowed

  My colleague Kåre has already blogged about how to set the Operations Manager 2012 license, to be read here. However, I have experienced this command fails – even when running from an elevated Operations Manager Shell – giving error about registry access:   Solution: Instead of spending hours messing up the the security in registry, simply run Windows Powershell as Administrator, and import the Operations Manager module, by using the “Import-Module OperationsManager” cmdlet. When this has been imported, run the Set-SCOMLicense command and you should succeed:

By |2012-12-11T13:38:37+01:00december 11th, 2012|Operations Manager (SCOM)|18 Comments

Eject CD script, quarantined by FEP! PowerShell to the rescue!

I guess everyone knows that you can’t enable BitLocker on a machine from a Task Sequence if there is a CD in the CD drive… The workaround is quit simple, just run a script to eject the cd drive before running the “enable BitLocker” step. Well the other day this script, a vbs, I use, was removed by Forefront.. I guess the heuristic scan evaluated the content of the script to be unsafe, and quarantined it.. This is obviously not good, as it’s needed by the task sequence… So I thought, maybe there is a way to eject the CD [...]

By |2012-03-22T12:25:53+01:00marts 22nd, 2012|General info, OS Deployment, Powershell, Security|3 Comments

Small useful scripts–Changing Driver Package source (PS1)

I have this customer who had to move all driver packages from from one server a another. This of cause meant all the Data Source references had to be change as well. Once al the packages were moved to the new server I ran the following  two scripts to change the source. All you need to change is the $Site to your site code, or add it is a parameter when you run the script. You will obviously also have to type in the old and new path. Syntax: Script.ps1 –Site XXX If you want to only run against one [...]

WMI/ConfigMgr Scripting: CreateEmbeddedObjectInstance (.NET) or SpawnInstance (VBScript) in PowerShell

  During the development of the script I posted yesterday, I noticed that a lot of people had problem discovering how to create WMI objects in PowerShell. I found different suggestions, but they all had problems. When I have to create WMI object instances I use this this method, which I used in my old script about sharing folders here is an example: $SecDesc = ([WMIClass] "\\$ComputerName\root\cimv2:Win32_SecurityDescriptor").CreateInstance() using configuration manager development we have to create a lot of wmi objects. Take a look at this SDK Sample in the VBScript example we have this line: ' Create and populate a [...]

By |2011-09-27T10:22:30+01:00september 27th, 2011|Configuration Manager (SCCM), Powershell, Scripting & Development|Kommentarer lukket til WMI/ConfigMgr Scripting: CreateEmbeddedObjectInstance (.NET) or SpawnInstance (VBScript) in PowerShell

System Center Orchestrator 2012 Beta: Using Run .Net Script Activity – PowerShell: Inputting and Returning Data

[download id="50"] This article describes how to use the Run .Net Activity to run PowerShell Scripts. I have created an example runbook which does the following: Start once every minute. Read a text file containing a list of sites/servers. Parse the list to PowerShell script. PowerShell script tried to ping each address and get the response time. PowerShell script output formatted HTML, ready to put inside a HTML Table, containing the addresses and response time. Runbook writes a web site based on a HTML template. The result is a website, in my case it looks like this: NB! some websites/server [...]

Powershell – WMI: Working with Shares – Part 1: Creating a Share with Custom Permissions

Download Script: [download id="12"] Intro: Last week, i was teaching a Powershell course (MOC6434), when a student asked me, how to create a share with custom permissions via WMI. I tried to find an answer for him, but could not really find any examples, cmdlets or functions for it. I found some examples and help in vbscript, so i decided to make some powershell functions of my own. I Created these functions that uses the Win32_Share class of WMI. They support remote creation and multiple permissions. New-Share is for creating a share. New-ACE is for creating one or more ACEs [...]

Powershell Acticvesync wipe

In this Powershell sample (created with ASE) - its possible to create a simple form to let Helpdesk manage Activesync Devices, this is done by finding and wipe/unwipe the device. Feel free to change and clean-up ;-) - Try ASE - http://adminscripteditor.com/ - Its a great editor. #################################################################### # Program..........: ASExWipe.ps1                            # # Author...........: Kåre Rude Andersen ([email protected])          # # Bagground........: Utility to let helpdesk manage Activesync     # # .................: devices.                                      # #################################################################### #region Script Settings #<ScriptSettings xmlns="http://tempuri.org/ScriptSettings.xsd"> #  <ScriptPackager> #    <process>powershell.exe</process> #    <arguments /> #    <extractdir>c:\scripts</extractdir> #    <files /> #    <usedefaulticon>true</usedefaulticon> #    <showinsystray>false</showinsystray> #    <altcreds>true</altcreds> #    <efs>false</efs> #    <ntfs>false</ntfs> [...]

By |2009-02-11T17:05:46+01:00februar 11th, 2009|Powershell|1 Kommentar

Usefull Powershell Links and Books.

Links: Microsoft Scripting guys! Forum: Usually you will get very quick replys and help in there http://social.technet.microsoft.com/Forums/en/ITCG/threads Powershell 2.0 and others for All Windows (Windows Management Framework) http://support.microsoft.com/default.aspx/kb/968929 Writing Help for Windows Modules http://msdn.microsoft.com/en-us/library/windows/desktop/dd878343(v=vs.85).aspx Importing / Exporting Credentials in Powershell (Manually create Credential object) http://www.leeholmes.com/blog/ImportingAndExportingCredentialsInPowerShell.aspx Working wth ODBC: http://theessentialexchange.com/blogs/michael/archive/2008/01/07/multi-platform-database-access-with-powershell.aspx Create Custom Inputbox: http://www.microsoft.com/technet/scriptcenter/resources/pstips/feb08/pstip0208.mspx Working with Arrays: http://powershell.com/cs/blogs/tips/archive/2008/11/19/working-with-arrays.aspx Change Error Message Colors: http://www.microsoft.com/technet/scriptcenter/resources/pstips/aug07/pstip0817.mspx PowerBoots - Interface for creating WPF GUI's in powershell http://huddledmasses.org/powerboots-tutorial-walkthrough/ Powershell SDK: http://www.microsoft.com/downloads/details.aspx?FamilyId=E6E1C3DF-A74F-4207-8586-711EBE331CDC&displaylang=en Free PowerShell Commands for Active Directory http://www.quest.com/powershell/activeroles-server.aspx Blog: ADPowershell: http://blogs.msdn.com/adpowershell/ Outputting Calculated Coloumns in Powershell: http://powershell.com/cs/blogs/tips/archive/2008/11/21/outputting-calculated-properties.aspx The Scripting Guys: How does the RemoteSigned execution policy [...]