Tag | Powershell Posts

I'm doing some work now on an internal web application where I had to logon with an external test account before I could do anything. That got old fast, so I created a powershell script file to automatically launch IE, input the username and password, and click the submit button. I originally tried to do this with WatiN, which provides a much easier interface for controlling the browser than the COM object InternetExplorer.Application, but I couldn't get by the security exceptions explained in this ...
I just heard about Justice Gray's blog challenge from the latest episode of Hanselminutes while running today. Although I think his plan to read one developer book a week for the next six months is rather insane, I agree with the premise that setting specific goals publicly is probably the best way to hold yourself accountable. Here are my goals for the next 6 months: Add Tools to my Developer Toolbox - My productivity and troubleshooting skills would plummet if I were to suddenly stop using utilities ...
To detect the version of AS, use ADOMD and connect using a connection string like "Provider=MSOLAP;Data Source=<server>;" where <server> is the name of your server. If you have the 2000 and 2005 providers on your system, the 2005 provider will attempt to connect to first and will then fall through to using the 2000 (v8) provider if the server is an AS2000 server. Once you have an open ADOMD connection you can check the value of the ServerVersion property of the connection. A value with ...
Here is a good joke to play on one of your developer buddies if they have powershell and SQL Server installed on their local machines and you have sa rights on the SQL Server for whatever reason (former debugging help, open environment between developers, blank sa password, or mad hacker skills on your part). Wait until they are busy typing and execute the following query in Query Analyzer (or using sqlcmd.exe if you want to be a purist) against their SQL Server. You may want to lock down your own ...
I just found out that I passed the beta for 70-238 (Pro: Deploying Messaging Solutions with Microsoft Exchange Server 2007). I had previously passed the beta for 70-237 (Pro: Designing Messaging Solutions with Microsoft Exchange Server 2007). Unfortunately, as detailed here, I did not pass 70-236 (TS:Configuring Exchange Server 2007) and I did not get a chance to take it in beta due to some scheduling conflicts. I don't think there is any sub-designation for passing just the IT Pro tests but not ...
I've been impressed by the attention paid to discoverabiltiy in powershell, which has allowed me to quite a bit of learning without ever leaving the command line. Here are a few of my favorite features: Guessing - This may seem strange to list as the number one discoverability feature, but I think the Powershell design team did an excellent job of exposing functionality through well scoped cmdLets that are logically and consistently named. With cmd.exe, the majority of the heavy lifting is done by ...
I've been spelunking Powershell lately with Bruce Payette's excellent book, Powershell in Action, and thought I would take a step back from some of the lower level nuances, such as dynamic type conversion and parameter binding rules, and organize my thoughts at a higher level. What is Powershell? - It is the new command line/scripting environment from Microsoft that replaces cmd.exe and WSH. You can install it as a small, free OS update on Windows XP, Windows 2003, and Vista as long as you have the ...
I don't think I am violating the multi-paged pre-exam NDA by offering this tip after sitting for 70-236 this morning: know they powershell syntax and commandlets. Easily 75%+ of my test involved trying to choose which syntax I should use to perform a configuration related task in Exchange 2007. I have heard there was some powershell on the exam. I even looked over the "skills being measured." This is the only item among 20 or so: "Implement bulk management of mail-enabled objects." Hmmm. I was not ...
Hmm.....I have a very under utilised Blog. Very sad indeed. Not sure if that's because I have nothing to say or I am just too lazy to put it up. Probably the latter. Anyways, I attended a Windows Server 2008 Technical Readiness event yesterday in Melbourne. As I was too busy in the past, I never had a chance to look into what new goodies Windows Server 2008 will bring, so I thought this would be a good opportunity to find out more. Surprisingly, the session was quite informative and did not turn ...
A few years ago I shifted roles from a developer team lead who coded almost full time to an Architect. Although I am naturally a bit of an abstract thinking and find architectural issues interesting, I have always been hesitant about this role because of the ubiquitous Architecture Astronauts that have given the discipline a bad name. These guys have a knack for intimidating even the smartest of developers by throwing around architectural jargon that they can describe in the abstract but are completely ...
I was reading an old post on Scott Hanselman's blog about accessing private feeds via RSS. The discussion turned toward comparing RSS reader requests to OFX requests that applications like Microsoft Money make to banks. A comment from "Jordan": No CTO wants to have his face on the cover of the Wall Street Journal because his site provided an RSS feed to Bloglines and Bloglines has a security breach that exposes all that information. I have several private RSS feeds that I would not trust a third ...
I am sure most of you (not talking about the BizTalk gurus out there J) have worked with some of the open source utilities available for BizTalk such as the BizTalk Adapter Wizard or the BizTalk Server Pipeline Component Wizard or BizUnit. However what some of you may not know is the wealth of other open source utilities for BizTalk available on CodePlex. Here are some of the interesting ones and their descriptions as found on CodePlex : SDC Tasks Library - . The SDC Tasks are a collection of MSBuild ...
Dale Churchward is impressed by NetCmdlets, which he found after David Aiken posted about the NetCmdlets stickers being given away at TechEd. Harry Pierson liked the PowerShell skinned XBox that /n software had at the NetCmdlets booth. Did you get your PowerShell sticker yet and enter the drawing for the XBox? If not, do it now! Jeffrey Snover keeps on doing "snoopy dances" about PowerShell. Who can blame him ...
You have to love this awesome introduction to NetCmdlets: My previous, scathing, blood-drawing, bruise-inflaming, vein-popping critique of the lack of SSH awareness in the Port25 show has lead my hate-filled, black heart to NetCmdlets by nsoftware.com. Just hilarious. Hopefully NetCmdlets lightened his heart a bit. Also, as I mentioned in the last post, note that /n software's new PowerShell Remoting (beta) was just made available. The PowerShell Remoting server (SSH terminal service) allows interaction ...
Marco Shaw is PowerShelling from his blackberry by running /n software's new PowerShell Remoting server along with the "Mobile SSH" client application for wireless handhelds . You can connect to the PowerShell Remoting client using any SSH tool, or even create your own custom client using a developer tool like IP*Works! S/Shell development toolkit. Technorati : Netcmdlets, PowerShell, nsoftware, ssh ...
Setting access control lists on IMAP servers is a pain. But here's how you can do it very easily with the get/set-imap cmdlets included in NetCmdlets. Retrieve the access control list of my Inbox from the IMAP server, by specifying the -acl flag parameter: PS C:\> get-imap -server 1.2.3.4 -user lance -password mypass -acl Mailbox Rights User ------- ------ ---- Inbox lrswipcda lance PS C:\> Now the access control list for a specific folder: PS C:\> get-imap -server 1.2.3.4 -user lance -password ...
This month we had two new speakers in South Florida! On May 1st at Citrix in Ft Lauderdale, Vishal Shukla presented an Ajax based web application he and his two co-workers wrote for the Palm Beach emergency operations. He did a really great job of pointing out the user interface features that make the application easy for people to use just like a windows app. On May 8th at DeVry Univeristy in Miramar, Max Trinidad presented an overview of various scripiting languages and tools including powershell ...
According to eWeek, Microsoft will release the third beta, which is also the first pubic beta, for Windows Server "Longhorn" today. So far, Longhorn remains on track for RTM in the second half of 2007. More than 10,000 people have already tested the product either directly through Microsoft's technical beta program or through Community Technology Previews through TechNet or MSDN subscriptions. Windows Server "Longhorn" will build on the improvements made in Windows Server 2003 R2, and add the ability ...
Powershell, is a great tool for handy scripting. It is often needed that you need to write sql scripts in isolated files. The is good in terms of finding errors in script, and focusing on one part while developing part of the sytem.But , as the number of script files grows big , the deployment issue becomes a headache for the release manager to handle your scripts. I used to think that the best solution, for merging files, is to use dos copy /xcopy commend, but this often gets screwed up for really ...
There are 14 core tracks and 2 virtual tracks at Tech·Ed this year, which will cover more than 1,000 sessions. In case you're wondering, a virtual track is a collection of sessions or labs that share a common theme but span several tracks. Microsoft has revised the technical tracks slightly since my original post, so I have updated my summary. Architecture Service Oriented Architecture (SOA) Office Business Applications Software as a Service (SaaS) Business Capabilities Software+Services Industry ...

I'm so excited about this...

Read the announcement here

Microsoft has a released a new technology showcase site called Dinner Now. From the website: DinnerNow is a fictious [sic.] marketplace where customers can order food from local restaurants for delivery to their home or office. This sample is designed to demonstrate how you can develop a connected application using several new Microsoft technologies. The demo utilizes several technologies including: IIS7, ASP.NET Ajax Extensions, Linq, Windows Communication Foundation, Windows Workflow Foundation, ...
Jason Prickett has a post up on using PowerShell with the Team Build Object Model: This entry is based on Team Build's next version which is available in a CTP release right now, and will be in Beta very soon (don't ask, I don't know when). In the next version of Team Build, we have included an Object Model (OM) that wraps all the functionality of the Web Services. This makes writing your own apps that need build information, much easier. As I talk about how to use the methods and objects in the ...
For anyone intersted in doing PowerShell cmdlet development, Mike Stall has a good post on using Visual Studio to create and debug cmdlets: Here's how you can get a sweet Visual Studio development experience for building and debugging your own PowerShell cmdlet:- It has Wizard support for initially creating the cmdlet, - intellisense- F5 build support which also registers your cmdlet- provides the full power of the VS debugger including Edit-and-Continue when debugging your cmdlets. I've not done ...
From Arlindo's blog I found an awesome Longhorn Hypervisor Virtual Server demo given at Microsoft. This is the new Longhorn server running the server core role with 8 cores! They show a few different things in the demo like hot adding a NIC to a running VM with PowerShell. Technorati tags: Longhorn, Virtualization, Server Core, Virtual Server, Hypervisor ...
The Windows PowerShell Team Blog has a nice post, including sample code, on Start-Demo: Help doing demos using PowerShell: I decided I had had enough of that nonsense and decided to write a script which would run a demo for me. I've called this function: Start-Demo. I've attached it to this blog entry. I have to say that I'm pretty please with how it came out. I'll not pretend that I completely understood the script, being the PowerShell novice that I am. However, I did think it was an interesting ...
Scott Hanselman has a little TODO batch file that he uses to quickly email himself notes from the command line. I have something similar, but mine is a PowerShell script that uses NetCmdlets. The cool thing about the send-email cmdlet in NetCmdlets is that it supports SSL as well as other email features like html mail and attachments. There are separate cmdlets for sending other types of messages like Usenet newsgroup articles, Jabber IMs (ie, Google Talk), SMS messages, SNMP traps, etc. Here is ...
Brandon updated his get-uptime script to output a custom object. Brandon's script works with the LastBootUpTime property returned from WMI Win32_OperatingSytem. I already talked briefly about the get-snmp, set-snmp, get-trap, and send-trap cmdlets that are included in NetCmdlets. Here's how you can use get-snmp to get the sysUpTime from any SNMP-enabled device. Note: sysUpTime is defined as the time since the last re-initialization (ie, boot) of the device, in 100ths of a second. get-snmp -agent ...
Bruce Payette's Windows Powershell in Action is now available on Amazon ...
Today I got my brand new Zune MP3 player which I did win at a Microsoft Event. Lucky me ;-). Ok install the software and you are ready to rockn roll, I thought, and I was wrong. Very wrong. At 94% of the installation it did stop with an error which was there even after a reboot. A quick Google search did confirm that other users had this problem also. One of the possible installation problems was the the Users group has the wrong name. Aha! I have a German Windows XP where the Users group is named ...
There are 14 core tracks and 2 virtual tracks at Tech·Ed this year, which will cover more than 1,000 sessions. In case you're wondering, a virtual track is a collection of sessions or labs that share a common theme but span several tracks. The Session Scheduler launches in April and we will get our first real look at the actual sessions available in each track. Until then, we have to be content to speculate. Looking at the technical tracks page, it became clear to me that there is a lot of information ...
You cannot use get-credential without some type of prompt (although you can do it without the pop-up dialog), however you can save your securestring password to a file, reload it for later, and manually create a credential without a prompt. Of course the problem with this is that your password will be exposed to anyone with access to the file, so do this at your own risk. First, choose your password and write it to a file: PS C:\> read-host -assecurestring | convertfrom-securestring | out-file ...
We are approaching the registration limit of 600 so get registered now! Info: http://codecamp.fladotnet.com Register: https://www.clicktoattend.c... Sessions: .NET Reflective and Adaptive Programming :: 20 Tips Every Developer Should Know About The CLR :: Using 3rd Party tools with CSLA :: Active Reports :: Advanced Code Generation using CodeSmith 4.0 :: Agile Development for Microsoft Technologists :: Amazon Elastic Compute Cloud :: Amazon Simple Storage Service :: The ...
The blessed creators of PowerShell have smiled upon us and now provided the release version of their rich shell interface for Vista. In honor of this momentus occasion I have decided to also bring a gift to the table. I took a couple of hours and updated the great introductory walkthrough document for PowerShell done by Ryan Paul so it's consistent with the release version. Ryan comes from a strong background in Linux, with lots of experience using great shells. His write-up is the perfect thing ...
You'll get the error "No Windows PowerShell Snap-ins are available for version 1" if there are no snapins installed for PowerShell v1. But the tricky part is that more precisely you'll get this error if there are no snapins installed for v1 for the platform you're running on. So you'll get this error if you are in a 32bit powershell console and you try to call add-pssnapin on some snapin that builds or installs itself only for x64 (like the Exchange Management Snap-in). You'll get the same if the ...
Some have wondered why Vista took so long to get to us. What's the big deal about it anyway? Well, it's much more than a pretty face and the fancy new communication features of WCF. Okay, so that was all it was going to be originally. A marginal upgrade. A hop between Whistler and Blackcomb, and its code-name told it all: Longhorn is just a small bar nestled between those two giant mountains. But when Blaster and other embarassing attacks surfaced in the 2003 timeframe, the original plans to make ...
Recently Marco Shaw posted a little nntp-stats script in the microsoft.public.windows.po... newsgroup that I thought was pretty neato, and right up my alley since we were in the middle of adding get-nntp and send-nntp cmdlets to the /n software NetCmdlets product. So as a tip of the hat to Marco, here is my version. Poster Stats: Get-nntp returns a collection of objects containing the subject, articleid, sender, references, etc of articles posted in a particular newsgroup. I put together a few ...
This is not a post about .Net remoting. And its not a post about accessing PowerShell through ssh. Here I'm talking about sending remote executions through rexec, rshell, and secure shell connections. Rexec and Rshell (rsh.exe) already exist as command line applications, but they do not exists in the PowerShell world (that is, they do not return objects). NetCmdlets send-rexec and send-rshell cmdlets take care of this problem. Each remote execution returns a collection of objects that contain the ...
Adrian at soapyfrog posted a function recently for grabbing the contents of the PowerShell console buffer and pushing them out as html. I saved it and finally got around to using it today. Very useful, added to my profile. Thanks Adrian! PS C:\> (get-nntp -server msnews.microsoft.com -newsgroup microsoft.public.windows.po... -list 5) | sort From Number : 7804 Subject : Re: More.com?? Quirk From : "/\\/\\o\\/\\/ [MVP]" Date : Tue, 23 Jan 2007 19:53:16 +0100 Size : 2610 References : <9eo6r256msnc3cvm527hm62... ...
Today we dug into the new Group Policy features found in Vista. There's 800 new policies altogether, so wow is there lots to see! Plus there's a new XML-based format used to store the information, the ADMX files by which you create the "Central Store" on the domain controller. So lots of neat new things there. After having fun implementing policy around the classroom, we dug into PowerShell in the afternoon. That's truly a significant feature, one that will change the landscape of network administration. ...
I just added another sample to the Analysis Services Stored Procedure project. The following text is copied from the Wiki documentation which I just updated. This function is not currently available as part of a compiled release, but it is available from the source code repository, so you can download the code and compile it yourself. I also have a Powershell based variation of this proc which was actually how I prototyped the technique. I plan to polish up the rough edges of that script and post ...
Here's how you can change your active directory (or other ldap server) password with the set-ldap cmdlet in /n software NetCmdlets. Also, recently I also showed how to this using the IP*Works! SSL LdapS dev component. PS C:\> set-ldap -server myserver -binddn Domain\Administrator -password admin -dn "cn=BillyBob,ou=Employees,d... -newpassword mynewpassword -ssl implicit Update: the -password parameter is now a secure string. There is also a -credential parameter. So the cmd to change the ...
Previously with NetCmdlets, authentication details were only accepted using plain text parameters. This is still supported, but now these cmdlets support PSCredentials through a new -credentials parameter. This works for almost all of the cmdlets included in NetCmdlets, like FTP, LDAP, HTTP, SMTP, Rexec, RSS, IM, SMS, SSH, etc. Here's an example with get-ldap. Before, you had to bind to the directory server using plain text parameters, like this: PS C:\> get-ldap -server testboy -binddn mydomain\admin ...
MOW's "PowerShelled" blog is another awesome PowerShell resource. Of particular interest to me was MOWs series on PowerShell and Active Directory. He used the .Net System.DirectoryServices classes to do all the work. here is how you can use /n software's LDAP cmdlet to manage directory servers like AD. The LDAP cmdlet supports plain connections as well as secure SSL connections. The LDAP cmdlet will work with any directory server, including AD, ADAM, OpenLDAP, Novell, etc. The LDAP cmdlet uses its ...
update: here's an updated function for uploading an entire directory tree: ## ftprecursiveupload.ps1: Recursive FTP Upload## Uploads a directory tree to a remote FTP server.## Returns an objects containing information about the files transferred.function upload-directory { param( [string] $server = $( Throw "You must specify an FTP server to logon to."), [string] $dir = $( Throw "You must specify a local directory to upload (ie, C:\Testing\FTPTest\)"), [switch] $overwrite = $false, [System.Management.Automati... ...
There are several friendly pages to help you get going. Assuming you are starting with VBScript, Microsoft has a Converting VBScript Commands to Windows PowerShell Commands page which will be your friend as you explore. Learn from their Task-Based Guide to Windows PowerShell Cmdlets. Get working examples from the Script Center Script Repository, and do not forget the Tools and Utilities. Download the latest version here ...
Windows PowerShell is a new shell scripting interface built on the Microsoft .NET framework that enables IT Pros and .NET developers to control and automate the administration of Windows and applications. It uses a new admin-focused scripting language and features more than 130 standard command-line tools. Download Windows PowerShell 1.0 Getting Started Guide and Quick Reference sheet PowerShell blog Cheers!!! Mahesh ASP.NET Interview Questions | C# Interview Questions | .NET Interview Questions ...
I found Vivek Sharma's blog through Jeffrey Snover on the MS PowerShell blog. He's got some good geeky stuff there, including some useful PowerShell posts. Vivek's out-ie is useful, so I snagged that for myself. I tried to create an out-ff but I hit a stumbling block because the Mozilla ActiveX Control requires a control container. out-html is not so useful because convertto-html already comes with powershell. NetCmdlets now includes a convert-data cmdlet which converts data to and from many different ...
Last year I posted the rules about how to remotely change your LDAP password. Its not very obvious because of the fact that the procedure depends on what server you're using (Active Directory, OpenLDAP, Novell, etc), and even then how your server is configured. Here is how you would change your password using the LDAPS component of IP*Works!! SSL (note, an SSL connection is required in order to change your password remotely if you are an Active Directory user. Otherwise you can do this with the LDAP ...

This tool does the trick with helping you navigate the complex namespaces of PowerShell and getting productivie immediately.

http://www.PowerShellAnalyzer.com/