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: [crayon-5bcfb1955ef00842888945/] 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: [crayon-5bcfb1955ef12854474389/] and in the C# example it [...]
How do create service windows in configuration manager by using PowerShell.
Note about array in powershell. How to create empty arrays and a little trick for adding to arrays.
Using PowerShell is a great way to administering your Office 365 configuration. This blog will describe what you need to get started.
System Center Orchestrator 2012 Beta: Using Run .Net Script Activity – PowerShell: Inputting and Returning Data
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: Creating new users from CSV with password and enabled accounts or How to Pipe into multiple cmdlets
How to create users from a CSV file, set their password and enable them in one command. This method shows you how to pipe the same output into multiple cmdlets by using the ForEach-Object Cmdlet.
Just came back from a customer which needed to limit the number of mobile device to one per mailbox. For this implementation the customer used all kind of smart phones, so the challange was also to find the unique Device ID from the Smartphone and add it to a Active Directory Attribute called: msExchMobileAllowedDeviceIDs. I created a Powershell script which read a text file and add the ID to AD. The script is also adding a dummy ID for all other mailboxes. It could also be disabled but the customer was more satisfied with the error from a wrong device [...]
Many people who have worked with PowerShell have reached this problem. You have a exe file in a folder that includes spaces. (fx. "C:\Program Files\") This exe file needs to be called with an argument that starts with "-". at the same time , you need to call it from another folder.
This post show how to do a list of all package structure in ConfigMgr 2007, via standard PowerShell.
Technet julekalenderen er godt igang og undertegnet deltager med spørgsmålet d. 22. december. Der er masser af spændende præmier i spil og en masse interessante spørgsmål. Spørgsmålet som findes nederst i denne blog post (fra d. 22. december kl. 09:00), kan besvares fra d. 22. december, når Bjarne Dollerup har givet startskuet, dette kan følgende på hans blog eller på Twitter (@ bdollerup). Svaret skal sendes som email email@example.com Den første som svarer rigtigt bliver kontaktet, og vinderen vil denne blive annonceret på bloggen. Spørgsmålet burde kunne besvares enten fra almindelig viden, eller ved at søge lidt på min blog. [...]
It is almost time for the annual Scripting Games at Microsoft Scripting Guys! Scripting games is a fun “competition” with a lot of different scripting challenges. This year it is held from April, 26 – May 7. I suggest all scripters to join the fun!, it is good practice for both newcomers and hardcore scripting guys!, since there is both a basic and advanced part of the challenges! All challenges can be solved in VBScript or Powershell. This year i have been selected to make one of the expert solutions, so check out my solution at VBScript: Advanced event [...]
One of our very good customers are managing servers with an dedicated internal administrator as a primary contact for each server. They are managing this one to one relation with an Excel sheet. A while ago we talked about automating this group creation with powershell, so the last time Jacob and I was discussing Powershell in Operations Manager we found a solution - Jacob who is the best Danish Powershell Guru of cause did a superoptimization of my first script and now its up to you to test it on your own. Please change the first lines of the script to [...]
Download Script: 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 [...]
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. [crayon-5bcfb1956a086387973991/]
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 [...]