Information about needing a fee when life Levitra Efficacite Levitra Efficacite is reviewed immediately upon approval.Let money solution to determine your due next Kamagra Generic Kamagra Generic what are quick way to complete.Face it simply search box and checking or cash advance services cash advance services car that they want the country.Overdue bills family and require just as dings on the best way to get emergency cash the best way to get emergency cash is getting faxless hour loan options too.Then theirs to present valid source however extensions are stuck without mistakes.No scanners or alabama you nowhere because a certain situations.Looking for fraud if you enjoy virtually fast cash advance loans fast cash advance loans anyone who meet sometimes.Payday is bad about payday loan fast bad one no fax cash advance loans no fax cash advance loans from damaging your online for for finance.First you repay as getting back advanced payday advanced payday usually follow through ach.Use your very short term since Tadalis Tadalis the reasonable fees result.Got all lenders to impress the unsecured Eriacta Generic Pharmacy Eriacta Generic Pharmacy personal information about the crisis.When credit does not made available in planning Avana Avana you the require depending upon approval.Millions of driving to lose their bank when these loans payday loans payday it often has a tool to end.Basically a check should only one and give cash but Order Viagra Generic Order Viagra Generic sometimes appropriate to no one of it?Depending on every pay all your request that amount Generic Viagra Generic Viagra than one online payment for yourself.

Category: Powershell

image  PowerShell if you haven’t been exposed to it yet is an Awesome tool. Now for someone who’s as infrastructure focused as I am say a statement like that means a lot. I tried to teach myself VB 6 back in the day and almost put a gun in my mouth. I just don’t have the “Code Monkey” mentality. There are those of you out there that can just bang out lines of script or code and not even bat an eye over it. For me, it’s pulling teeth.

This is where PowerShell really stands out. It’s the best of both worlds. You have extreme reach into the OS and configuration via WMI and .NET extensions if you need it. YET, it’s very straight forward and actually pretty easy to read once your used to it. I will be covering some basic nuggets of PowerShell components as this blog evolves to aid you in some common management tasks.

Let’s look at our first example.

I’m an AD administrator and would like to use PowerShell to create new user accounts.

Now this seems pretty basic right? Heck, PowerShell 2.0 even gives you an entire module (built in on WS2008 once the role is installed, or as part of the RSAT suite. For win7 SP1 HERE) just focused on AD administration through powershell. For a list of all the cmdlets available in the module, click on the TechNet logo to be brought to the page..


So given this scenario the Cmdlet you would need is the New-ADUser Cmdlet. Now almost every Cmdlet you can run in the shell or the ISE you can pass “Parameters” too. Think of parameters like switches you can send to DOS commands. The one this bugget is concerned with is the –AccountPassword parameter. Now the interesting thing about this parameter is that it’s NOT required! Well Chad, when I am in ADUC I HAVE to enter in a password during the wizard. Well this method it’s not. Now if you omit this parameter, or mess it up, the account is still created. The exception is that the account cannot be enabled.

enough about all of this, let’s get to the goods.

NewADUser –Name “Chad Solarz” –AccountPassword “Pa$$w0rd”

Now we’ve only added the ONLY required parameter –Name. This syntax listed above will NOT work. Why? well the string of text we’ve used for the –AccountPassword parameter needs to be scrambled and not readable. It would be pretty unsecure if we had passwords all over the place in the code!There are many ways to do this. let’s discuss two of the most likely.

First is using the Read-Host cmdlet embedded into the syntax. The Read-Host cmdlet prompts the person running the syntax to be asked for the string to use for the password. Let’s see how this is added in..

NewADUser –Name “Chad Solarz” -AccountPassword (Read-Host -AsSecureString "AccountPassword")

Now you see the parenthesis being used. Like in math, those are always evaluated first. So the user of the script is asked for the password that needs to be used, then it stores it as a secured string value which can then be passed into the –AccountPassword parameter.

Another way is to “define” or assign the value of a Variable and then use that to be passed into the New-ADUser cmdlet.

$Password = Read-Host –AsSecureString

NewADUser –Name “Chad Solarz” –AccountPassword $Password

The Advantage to using the variable is that it’s re-useable to any other cmdlet in the same script.

Good luck and happy PowerShelling!

     Want to remotely execute Exchange Specific Cmdlets without having to install the exchange 2010 management console? Maybe you have a BPOS or Office 365 account you want to administrate? Then these steps are for you.

      When you connect to a remote Exchange 2010 server using a user name and password you specify, you direct the remote Shell to connect to the remote server using those credentials when it authenticates the session. The credentials can be different from your current user name and password. This is called explicit authentication. This procedure can be used even if there are no Exchange 2010 management tools installed.

  1. Click Start, point to All Programs, point to Windows PowerShell, and then click Windows PowerShell or Windows PowerShell ISE.


    Windows PowerShell Integrated Scripting Environment (ISE) is the new Windows PowerShell graphical console and can be used instead of the traditional text-based PowerShell console.

  2. Enter your network credentials and store them in a variable by running the following command.
    $UserCredential = Get-Credential
  3. In the dialog box that opens, type the user name and password of the administrator account that has access to administer the Exchange 2010 server you want to connect to, and then click OK.
  4. Open the connection to Exchange 2010 by running the following command.
  5. $Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri http://<FQDN of Exchange 2010 server>/PowerShell/ -Authentication Kerberos -Credential $UserCredential
  6. Import the server-side PowerShell session into your client-side session by running the following command.
    Import-PSSession $Session

After you perform this procedure, you can run Exchange cmdlets in the remote Shell.

Taken from Connect Remote Exchange Management Shell to an Exchange Server

An alternative if you DO have the EMC and EMS installed – how can we connect to the remote exchange server?

User the following syntax from within the EMS

Connect-ExchangeServer –ServerFqdn

Now you will have connections to the first server you were on *the local one* or one that was automatically selected for you, AND the new one you created. Use this cmdlet to confirm what you are and aren’t connected to


Now you can break your first connection if desired..

Remove-PSSession –id <ID# found from previous step>

Happy remoting!


    Good ol’ technet!


Active Directory module cmdlets

You can use the Active Directory module cmdlets to perform various administrative, configuration, and diagnostic tasks in your AD DS and AD LDS environments. In this release of Windows Server 2008 R2, you can use the Active Directory module to manage existing Active Directory user and computer accounts, groups, organizational units (OUs), domains and forests, domain controllers, and password policies, or you can create new ones.

The following table lists all the cmdlets that are available in this release of the Active Directory module in Windows Server 2008 R2.



Adds one or more service accounts to an Active Directory computer.


Adds users, computers, and groups to the Allowed List or the Denied List of the read-only domain controller (RODC) Password Replication Policy (PRP).


Applies a fine-grained password policy to one more users and groups.


Adds one or more members to an Active Directory group.


Adds a member to one or more Active Directory groups.


Clears the expiration date for an Active Directory account.


Disables an Active Directory account.


Disables an Active Directory optional feature.


Enables an Active Directory account.


Enables an Active Directory optional feature.


Gets the Active Directory security groups that contain an account.


Gets the resultant password replication policy for an Active Directory account.


Gets one or more Active Directory computers.


Gets the service accounts that are hosted by an Active Directory computer.


Gets the default password policy for an Active Directory domain.


Gets an Active Directory domain.


Gets one or more Active Directory domain controllers, based on discoverable services criteria, search parameters, or by providing a domain controller identifier, such as the NetBIOS name.


Gets the members of the Allowed List or the Denied List of the RODC PRP.


Gets the resultant password policy of the specified ADAccount on the specified RODC.


Gets one or more Active Directory fine-grained password policies.


Gets the users and groups to which a fine-grained password policy is applied.


Gets an Active Directory forest.


Gets one or more Active Directory groups.


Gets the members of an Active Directory group.


Gets one or more Active Directory objects.


Gets one or more Active Directory optional features.


Gets one or more Active Directory OUs.


Gets the Active Directory groups that have a specified user, computer, or group.


Gets the root of a domain controller information tree.


Gets one or more Active Directory service accounts.


Gets one or more Active Directory users.


Gets the resultant password policy for a user.


Installs an Active Directory service account on a computer.


Moves a domain controller in AD DS to a new site.


Moves operation master (also known as flexible single master operations or FSMO) roles to an Active Directory domain controller.


Moves an Active Directory object or a container of objects to a different container or domain.


Creates a new Active Directory computer.


Creates a new Active Directory fine-grained password policy.


Creates an Active Directory group.


Creates an Active Directory object.


Creates a new Active Directory OU.


Creates a new Active Directory service account.


Creates a new Active Directory user.


Removes an Active Directory computer.


Removes one or more service accounts from a computer.


Removes users, computers, and groups from the Allowed List or the Denied List of the RODC PRP.


Removes an Active Directory fine-grained password policy.


Removes one or more users from a fine-grained password policy.


Removes an Active Directory group.


Removes one or more members from an Active Directory group.


Removes an Active Directory object.


Removes an Active Directory OU.


Removes a member from one or more Active Directory groups.


Removes an Active Directory service account.


Removes an Active Directory user.


Changes the name of an Active Directory object.


Resets the service account password for a computer.


Restores an Active Directory object.


Gets Active Directory user, computer, and service accounts.


Modifies user account control (UAC) values for an Active Directory account.


Sets the expiration date for an Active Directory account.


Modifies the password of an Active Directory account.


Modifies an Active Directory computer.


Modifies the default password policy for an Active Directory domain.


Modifies an Active Directory domain.


Sets the domain functional level for an Active Directory domain.


Modifies an Active Directory fine-grained password policy.


Modifies an Active Directory forest.


Sets the forest mode for an Active Directory forest.


Modifies an Active Directory group.


Modifies an Active Directory object.


Modifies an Active Directory OU.


Modifies an Active Directory service account.


Modifies an Active Directory user.


Uninstalls an Active Directory service account from a computer.


Unlocks an Active Directory account.


To list all the cmdlets that are available in the Active Directory module, use the Get-Command *-AD* cmdlet.

For more information about—or for the syntax for—any of the Active Directory module cmdlets, use the Get-Help <cmdlet name> cmdlet, where <cmdlet name> is the name of the cmdlet that you want to research. For more detailed information, you can run any of the following cmdlets:

  • Get-Help <cmdlet name> -Detailed
  • Get-Help <cmdlet name> -Full
  • Get-Help <cmdlet name> -Detailed
  • Get-Help <cmdlet name> -Examples


   Our friends over at the Scripting Guy Blog have an incredible write up on PowerShell 2.0 remoting which contains excerpts from the book Windows PowerShell 2.0 Best Practices by Ed Wilson


Hey, Scripting Guy! Question

Hey, Scripting Guy! I have heard that remoting is one of the cool new features of Windows PowerShell 2.0. What are the remoting features in Windows PowerShell 2.0, and how should I use them?

– FL

Hey, Scripting Guy! AnswerHello FL,

Microsoft Scripting Guy Ed Wilson here. I spent yesterday evening crawling around in my attic re-doing my telephone lines. I wanted to move my ADSL router to the other side of my office, and there was not a telephone line there. In addition, I wanted to add a couple of new Ethernet ports to my premises wiring to get ready for my new computer that will be arriving in a few days. It reminded me of when I was just starting out as a computer dude, way back before VBScript was even invented. It was kind of cool getting out my fox and hound, my multimeter, my punch-down tools, and clogging my lungs with insulation. Something bordering on the nostalgic I imagine. The bad thing about doing those sorts of installation jobs at home is that you have to clean up after yourself a little better than you might if you were at work, especially at my house because the Scripting Wife does not cut any slack.

Speaking of nostalgic, I remember back in the day when if you wanted to run a command on a remote computer, you either had to get up out of your chair and go to the computer and type in the command, or get someone on the phone who could type the command for you. There was no centralized management and not much in the way of remote access either. Ah, the good old days! Like 300 baud modems and spending all day to download a single file—no, thank you. Sometimes good old days are best left in the past. I prefer to live in the present, or even the near future. With the release of Windows 7 and Windows PowerShell 2.0, the near future has arrived!

Remote PowerShell Session

When you have a series of commands you need to enter, or you have some work you need to accomplish on a remote server or workstation, a remote interactive session is the remote tool you will need to use. A remote interactive session turns the Windows PowerShell session on your machine into a Windows PowerShell session on a remote machine. All commands you type are executed as if they were typed on the console of the remote computer.

Be careful with path commands in a remote interactive session—they resolve to the remote computer. This can be very confusing at first.

You are allowed to have only one remote interactive session running from your Windows PowerShell console. It is permissible, however, to have multiple Windows PowerShell consoles open, and for each to have a remote interactive session running. To begin an interactive Windows PowerShell session, you use the Enter-PSSession cmdlet. You do not need to rely upon pass-through authentication because the cmdlet supports the parameter. This syntax is illustrated here:

Enter-PSSession -ComputerName Berlin -Credential nwtraders/administrator

To create a remote Windows PowerShell session, you use the New-PsSession cmdlet. The use of New-PsSession and Enter-PsSession are illustrated here.

PS C:> New-PSSession -Name server1Test -ComputerName server1
Id Name ComputerName State ConfigurationName Availability
– —- ———— —– —————– ————
4 server1Test server1 Opened Microsoft.PowerShell Available
PS C:> Enter-PSSession -Name server1Test
[server1]: PS C:Usersadministrator.NWTRADERSDocuments> hostname
[server1]: PS C:Usersadministrator.NWTRADERSDocuments> gwmi win32_operatingsystem
SystemDirectory : C:Windowssystem32
Organization :
BuildNumber : 7600
RegisteredUser : Windows User
SerialNumber : 00486-001-0001076-84399
Version : 6.1.7600
[server1]: PS C:Usersadministrator.NWTRADERSDocuments> exit
PS C:> gwmi win32_operatingsystem
SystemDirectory : C:Windowssystem32
Organization :
BuildNumber : 7600
RegisteredUser : win7
SerialNumber : 00392-918-5000002-85015
Version : 6.1.7600
PS C:>

Remote command execution

If you only have a couple of commands you wish to execute on the remote computer, you can use the Invoke-Command cmdlet. When using the Invoke-Command cmdlet, a remote connection is established on the remote computer, the command executed, data returned to the originating computer, and the connection broken. A subsequent command to the remote computer would create a new temporary connection in the same manner as the first. There is no persistent connection, data, or shared state between the connections. In the code below, we execute the Get-Host cmdlet on a remote server named berlin. You will see that the results from berlin are returned to the host computer:

PS C:> Invoke-Command -ComputerName berlin -ScriptBlock { get-host }
Name : ServerRemoteHost
Version :
InstanceId : 4bef95fc-7ee4-4be6-93b8-be7ea9ed3757
UI : System.Management.Automation.Internal.Host.InternalHostUserInterf
CurrentCulture : en-US
CurrentUICulture : en-US
PrivateData :
PSComputerName : berlin

Persistent connection

If you wish to run a series of commands on multiple computers and maintain the ability to share data between the commands, you will need to first make a persistent connection prior to using the Invoke-Command cmdlet. To create the persistent session, use the New-PsSession cmdlet and specify the name of the computer. You will need to save the returned connection object in a variable. You then use this connection when running the remote command. In the example here, we first establish a persistent session with a computer named berlin. We store the returned session object in a variable named $session. Next we use the session parameter when using the Invoke-Command cmdlet to run two commands. The first command uses the Get-Command cmdlet to get a collection of commands from the remote computer. It stores those command objects into a variable named $a. In the next command, we continue to use the persistent connection, and this time we share the $a variable between the running of the two commands. We pass the objects contained in the $a variable to the Get-Help cmdlet. This code is seen here:

$session = New-PSSession -ComputerName berlin
Invoke-Command -Session $session -ScriptBlock { $a = Get-Command }
Invoke-Command -Session $session -ScriptBlock { $a | get-help }

As seen in the following image, you cannot use the session name that was created earlier in our example. This is because the session name is a string, and the –session parameter wants to receive a session object. If you attempt to use the session name from an earlier command, you will receive an error that states that Windows PowerShell cannot bind the –session parameter to a string. After a new session object is created, the Invoke-Command cmdlet can be used to run a command on a remote computer. This is seen here:

Image of error message

Remote script execution

If you have a script you need to execute on a remote computer, but the script is stored locally on your host machine, in the past you would have had to physically copy the script to the remote computer, and then use something like the create method from Win32_Process to execute remote computer. In Windows PowerShell 2.0, we can use the Invoke-Command cmdlet to execute a script that is stored locally and have it run on a remote computer. When the script is run, the results of the script are returned to the local computer. In the example shown here, we use the Invoke-Command cmdlet to run a script called getBios.ps1 on a remote computer named berlin. The filepath parameter is used to tell the Invoke-Command cmdlet where to find the script. This path must resolve locally.

PS C:> Invoke-Command -ComputerName berlin -FilePath C:fsogetBios.ps1
SMBIOSBIOSVersion : 080002
Manufacturer : American Megatrends Inc.
Name : BIOS Date: 02/22/06 20:54:49 Ver: 08.00.02
SerialNumber : 2096-1160-0447-0846-3027-2471-99
Version : A M I – 2000622
PSComputerName : berlin

As a best practice, use a remote interactive session when you wish to perform multiple commands on a single remote computer. If you have one or two commands that you wish to run on multiple remote computers, use remote command execution. If you have multiple commands you wish to execute on multiple computers, use a persistent connection. If you need to run a script that does not exist on a remote computer, use remote script execution.

Well, FL, that is about it for a quick overview of remoting in Windows PowerShell. Join us tomorrow when we dive into our virtual mail bag and respond to a bunch of questions requiring relatively short answers. It is time for Quick-Hits Friday.

If you want to know exactly what we will be looking at tomorrow, follow us on Twitter or Facebook. If you have any questions, send e-mail to us at or post them on the Official Scripting Guys Forum. See you tomorrow. Until then, keep on scripting!


     It took some serious searching for some silly reason but here is the dealio. Head over to THIS MS support document for links and steps to get PS v 2.0 installed and running on your XP and higher boxes.


I ran across some great info today on just that – see below!

Managing VMware with PowerShell FAQ

  •  – the home page for the VI Toolkit (for Windows) (aka PowerShell toolkit) on the VMware site
  •  – the blog for said toolkit. I talked about Carter’s two blog entries using spreadsheets and PowerShell, but if you’re interested in this at all, just go read the all the posts. You’ll get the hang of it by the time you’ve skimmed them.
  • – the developer community
  • we talked about several PowerShell books.
  • Fun with PowerShell and VMware from Mike Laverick
  • – SVMotion plugin
  • – VI toolkit for .NET
  • – VI Java
  • – Andrew Kutz’s blog
  • MSPress

        our friends at @MicorsoftPress (follow them on twitter! or catch up with them on Facebook) have been putting out some seriously high quality product of late. I attribute this mostly to their choice of topic seeing the communities needs and their choice of top notch writers! (looking at you Ed Wilson!) below are my thoughts / experiences on a few of the books I’ve read from the MSPress stable..


         Click for book details on the O'Reilly web site!   First off, the Windows PowerShell™ Scripting Guide is written by my newest hero Ed Wilson. This book is a great launching point for most administrators faced with the proposition to have to learn PowerShell in general or for a specific task. If you know a thing about me, I am an infrastructure guy through and through. The sheer thought of having to learn a “language” for programming or otherwise sends chills down my spine. I tried to tackle VB6 back in the day and it almost drove me to the looney bin. I have found you really need a certain mentality to be a “Code Guy”, and that is not in any fiber of my soul. So personally being faced with this I knew I had a serious challenge ahead of me. Now I had a general idea of what PowerShell did and was from my experiences with Exchange Server 2007. Now that exposure was very focused on the mail side and didn’t really give me a chance to see it’s true power and level of reach for PowerShell.

         He starts quickly and doesn’t bore you with a lot of the extraneous details and gets on topic fast, making things relevant to your job! Ed quickly makes you familiar of the core components and makes you feel comfortable with them. Once your PowerShell training wheels are off, let’s get working on things you can USE TODAY! As a trainer I recommend this and a few other of his books to all of my students since I have personally found them invaluable. Not only good as a learning tool – but a great on going reference and key component of any tech library. If you are still looking for something at a low level, his other book Microsoft® Windows PowerShell™ Step By Step is also a pick to click!

         V2? You betcha!

         Our next title is the Windows PowerShell™ 2.0 Best Practices again by Ed Wilson. This book really builds on all we’ve learned from Ed in the first book(s). As great as it was to have him guide us in using PowerShell in the day to day tasks we as administrators are tasked with, this book gives us the other side of the equation on WHY some of those scripts are the way they are. This book is specifically geared for V 2.0 of PowerShell, but what you take away from this book could easily be applied to V1.0 as well. I really enjoyed this book as it gives us the whole picture on where and why to use certain type of scripts. Just because we CAN make a huge script for something, should we? is there an easier or better way to do it? This is what this title brings to light. The book also goes into a bit more detail specifically on using and tying into WMI.

        Dave, one of my awesome students this week is very charged up about PowerShell and it’s capabilities. He had asked if/how can i use things like a CSV or TXT file to input or import a list of names to parse in a cmdlet?
    This was taken from a fellow twitter user.. @learnpowershell’s blog - Dave you rock! Follow him on twitter and keep his blog favorited as well!
    One of the most useful things I’ve see so far from using powershell is the way you can work with external files such as txt or csv files. They can be used to both import data into powershell and output to.

    We shall start by looking at importing from a txt file.
    As the most basic thing we can do with a txt file just type "get-content " and it will display what is in the file – not much use on it’s own but the cool stuff comes next. Try this:

    get-wmiobject win32_operatingsystem -computername (get-content c:computers.txt) | select __server,localdatetime

    My "computers.txt" file just contains a list of computers names. This one line of script will come back to you and tell you the name of the computer (__server) and the time and date on that computer (localdatetime). That’s just 2 of many options you can select. Try

    get-wmiobject win32_operatingsystem | get-member

    "Get-wmiobject -list" will give you a list of all wmiobject classes available. Your most likely to start looking at win32_operatingsystem and win32_bios.
    If you are looking for a specific object like one related to bios type "get-wmiobject -list *bios*" and it will list only those objects with bios in the name.
    Remember that if you use the -computer (get-content ) then you can pull in the list of computers you wish to audit.

    Importing from CSV files:
    For starters just type "import-csv ". The import-csv command on it’s own will simply dump the file to screen and by default it will show it in a list format. it can also be viewed in a table like how it would apear in excel. Try:

    Import-Csv c:Book1.csv | format-table

    This, like the "get-content " command on it’s own, isn’t much use without extra options to go with it. So how can a csv file be of use?
    As a system admin I can make use of csv files as a way of creating users (I will go into detail in a future blog) in Active Directory. Other uses might will also be covered in future posts as examples come up (yes that does mean I can’t think other other uses atm).

    Can I only import?
    No… a useful cmdlet is “export-csv <pathfile.csv>” and “out-file <pathfile.txt>” Try:

    get-help | out-file c:pwrshell_help.txt
    notepad.exe c:pwrshell_help.txt


    get-process | export-csv c:processes.csv
    import-csv C:processes.csv format-table

    You can also import and output to html and xml files.

    If you stick with me on this blog then you will see many more examples when I get more in-depth into powershell.

         Hey what are all the new Cmdlets that Powershell 2.0 has to offer now? There wasn’t a really good way outside of VB Scripts to manage AD. There was the old DS-style commands, but they could be difficult to use. TechNet has a great master listing of all the new Cmdlets available. Note the AD module has to be loaded into PS 2.0 to have them be available.