Tag | Powershell Posts

I think there's nothing more powerful for a .NET developer than the ability to call into the .NET framework from script code. Here are a couple of tips for calling into the framework from PowerShell 1.0: For non-static .NET classes, use the New-Object commandlet (example using the SecureString class) In c# System.Security.SecureString password = new SecureString(); In PowerShell: [System.Security.SecureStri... = New-Object System.Security.SecureString You don't have to explicitly cast the ...
To Download the SQL Server Express Management Studio Express 2008 for SQL Express 2008 R2: (Begin June 2011 Update) Database Only Management Tools Database with Management Tools Database with Advanced Services SQL Server Database Engine SQL Server Management Studio Express Full-Text Search Reporting Services Download Size ( 32-bit | 64-bit ) 58.1 MB | 74 MB 154 MB | 163 MB 235 MB | 247 MB 727 MB | 795 MB Install (End June 2011 Update) I was recently doing a personal site and wanted to use VWD and ...
So I’ve been using PowerShellPlus for the last few days, and in short – its awesome. The ability to put my script editor on one monitor, click run right there and see the results of the script on the other monitor made me very happy. :) If you haven’t checked it out, you definitely should. Its basically an integrated development environment for PowerShell scripting and debugging. A PowerShell console combined with an editor complete with watch window and step-through debugger. As soon as you type ...
I am a BizTalk developer since BTS 2004 came. And recently did BTS 2002 Migration too Recently I have been observing few Microsoft announcements and which made me to say this... First look at what I have observed... Look at Microsoft Application Server Roadmap-->Dublin Look at the Microsoft Future Modeling related articles-->Oslo Wow, it seems Microsoft is all over Europe.. Ok, here is my observation from what I heard, looking at these kind of announcements BizTalk 2009 might be the last XLANG ...
Have a look at Brian Harry’s blog entry on the next generation power tools probably available end of October… A new team menu with presence, and team based tasks… A new way to download project related custom add-ins like check-in policy and Custom work item control. This is something I commented about way back in 2005 as a big hole to fix. I’m glad they tackled this. This is going to be very sweet in a corporate environment. Shell integration looks great but I’m not really a fan of that. I would ...
Powershell Demonstration & End-User Reporting With SQL Server 2008 When: October 21, 2008 Time: 4:30 PM - 7:30 PM Visit www.mnssug.org Topic One: Powershell Demo Speaker: Rajib Bahir, e2D Powershell is the newest tool added so that DBAs can batch things easily and do other admin related chores. I will show how we can work with SQL server in command prompt. Rajib Bahir is a BI/SQL developer consulting for e2D and iCSQL. He is also training others on SQL courses at Minneapolis Community Technical ...
Well, here goes, my first Powershell script that I’m just a slight bit proud of because it’s not lame brain… 1: param( 2: [string[]]$account = @(), 3: [string[]]$computers = @(), 4: [switch]$help 5: ) 6: 7: 8: Get-WmiObject win32_service -ComputerName $computers | where-object {$_.startname -eq "$account"} | sort-object systemname | format-table systemname,displayname,star... | out-host 9: 10: if($help){ 11: @" 12: SYNTAX: 13: get-servicesbylogon.ps1 -account "domain\user" -computers "computer1,computer2" ...
There are lots of times when I want to do a "Clean" of my VS.NET solution. Obviously, the most common way to do this is to right-click your solution in the solution explorer and select "Clean Solution". However, there are 2 drawbacks of this. One is that if you have files sitting in your bin or obj directories that are not in some way linked to your solution, they won't be removed. Additionally, sometimes you just want to do a quick clean of a directory structure without having to fire up VS.NET. ...
The question was posed on the newsgroup: how do I delete emails (over POP or IMAP) on a remote mail server through PowerShell? Here’s an example of one way to do it – through the use of the get-imap, set-imap, and get-pop cmdlets that are included in NetCmdlets. ## deleteemail.ps1: Delete all email from a particular sender ## deletes emails from an IMAP or POP server. ## Returns a collection of objects containing information about deleted emails (from, to, subject) or mailboxes (name, flags) in a ...
For those in East Arkansas and West Tennessee, I’ll be visiting the Memphis .Net User Group on September 25th 2008. David Mohundro, the co-founder of the Fort Smith .Net User Group, will be presenting on PowerShell. You won’t want to miss this presentation, as there is some terrific tie-ins with Visual Studio. My main purpose will be to meet with the guys starting up a Northeast Arkansas .Net User Group in Jonesboro, Arkansas. If you’re interested, in helping out or attending the new NEADNUG group, ...
If you’re into PowerShell at all and you haven’t listened to the PowerScripting Podcast, you should definitely check it out. I know you’ve seen me write about the show before, but I also know that alot of us don’t have time to listen. Try downloading a copy and burning it onto a cd for your drive home, or copy it onto your mp3 player. The show is done by Hal Rottenberg and Jonathan Walz, two great guys who are a big part of the PowerShell community and who work hard putting together a great show. ...
[Source: http://geekswithblogs.net/E... There are a couple of reasons why you might want PDB files available in the GAC, say if you're running coverage reports over unit tests as part of your CI build, and the assemblies being instrumented all live in the GAC, or if you want to deploy BizTalk PDB files as a troubleshooting aid. Patrick Cauldwell has a PowerShell script to install PDBs to the GAC, which is a good basis for an MSBuild task to do the same. The principle is straightforward ...
“Quintas" was another of the winners of the PowerScripting Podcast’s NetCmdlets scripting contest. Quintas submitted an espn-download script, which retrieves podcast feeds from espn.com and downloads the mp3 files for later listening. Here is Quintas’ script: # ESPN-Download param($DownloadDir=$(throw "Usage: ESPN-Download.ps1 DownloadDirectory Show LatestorAllDownloaded`nShow... Mike & Mike`n2. PTI`n3. Around The Horn`n`n[L] for latestshow or [ A ] for All shows`n"), [string]$ESPNShow=$(Read-Host ...
Its easy to forget about the –debug parameter, but a lot of times it can be very helpful, especially with NetCmdlets where in many cases –debug will output the protocol interface (the “PITrail” as we call it at /n software) of the connection. The PITrail includes a trail of communication between the cmdlet and the remote host it is talking to. Rob emailed me to ask for help diagnosing a 425 error he was getting when using the NetCmdlets get-ftp cmdlet. As I described to Rob, in a nutshell the 425 ...
Mark Schill was another of the winners of the PowerScripting Podcast’s NetCmdlets scripting contest. Mark submitted a tweet-im script, which sends an instant message about new tweets found in the Twitter RSS feed. They explained on the podcast that Twitter used to have an IM-bot feature which went away, so Mark created this script himself to meet this need. The script simply sits and fetches your Twitter friends timeline feed every x seconds, checks to see if the items it finds are newer than the ...
Over at the PowerScripting Podcast, the winners of the NetCmdlets scripting contest were announced. Meanwhile I was having some awesome vacation time in the beautiful Outer Banks of North Carolina. Winners for the /n software Netcmdlets contest are: Steve Hiner - Wrote a wrapper for Send-Email script to send email using Gmail's SMTP server Mark Schill - Sent in two entries, the one we've chosen to highlight is his Twitter IM client bot thingy. It uses Send-IM and Get-Http Quintus - A script to download ...
Recently the BT Broadband ADSL line at our shared office has been having problems. Slow speeds but more importantly regularly dropping out. We moved over to a second broadband connection but wanted to monitor the state of the original broadband connection so we could confirm the fault had been fixed. Should I code it in C#, thrash out some PowerShell scripts, pah! No, an old fashioned .cmd file and some batch commands will do ..... need to know the time, try a ping, and then wait for 10 seconds before ...
For those of you who attended my talk or for any other interested parties, I have uploaded my slide deck from my MVP Theatre presentation at Tech.Ed Australia 2008 to my sky drive here: There is not too much to this deck as the presentation was mainly demos. If you are just after the links to the tools I demonstrated I have included them below: MDX Studio BIDS Helper Analysis Services Stored Procedure (ASSP) project PowerSSAS (which unfortunately only got a brief mention) And here are the links to ...
An easy way to convert data to/from base64 (or uuencode/uudecode, quoted-printable, url encode/url decode, JIS, Yenc, hex, or even creating md5 or sha1 hashes) is to use the NetCmdlets convert-data cmdlet. To encode: PS C:\> convert-data -data "Hello, World!" -to base64 Data Size Format ---- ---- ------ SGVsbG8sIFdvcmxkIQ== 20 base64 To decode: PS C:\> convert-data -data $encoded.Data data -from base64 Data Size Format ---- ---- ------ Hello, World! 13 Plain Technorati Tags: PowerShell, NetCmdlets, ...
The latest from Antoine Habert is that PoshBoard 0.3 is out at codeplex. He's posted release notes and a quickstart on his blog. update: fixed links. Technorati Tags: PowerShell, PoshBoard ...
One of the cmdlets I use most often in my scripts is test-path, which simply tells you whether or not a particular file or path exists. Below is test-remotepath, which I use to tell me if a remote file or path exists. This particular script uses get-ftp from NetCmdlets, but it could also just as easily be done with rexec, rshell, or even ssh (sexec). ## test-remotepath.ps1: Tests if a remote file/path exists ## This script uses ftp to determine whether or not a remote file or path exists. ## This ...
Blogging so that I can find these again when I have time to watch them...:) Ø Introduction to Microsoft Dynamics CRM, Susan Sauls Ø Intro to SQL Server Data Services, Soumitra Sengupta Ø The Spy Who Hacked Me! , Alex Smolen, Rudolph Araujo Ø How Microsoft SQL Server Helps You to Lower Your Cost of Storage, Torsten Grabs Ø Microsoft System Centre Virtual Machine Manager 2008: Overview, Edwin Yeun Ø A Hackers Diary: How I Can Hack Your Vulnerable Services and How You Can Stop Me, Marcus Murray Ø Advances ...
Been poking about in Windows Powershell. It's pretty sharp. I like it, and it's powerful as heck, but I am having to learn how to add to my toolset. Seems like I don't need it every day, but when I do, it's just the thing. Anyway, I'd read about arrays in PS for sometime without really thinking about something: PS flattens arrays. No multidimensional arrays at all. Which, of course, confused me, given the power of MD arrays. So, why would they do that? Only thing I can think of is that PS creates ...
This threw me for a loop today. You can't call a PowerShell function with commas "," or parentheses "()" and have it believe it goes to both parameters. Try running the following and see what your output is on every line call to "foo." function foo([string]$a, [string]$b) { Write-Host "a:", $a, " b:", $b } foo("A", "B") foo "A", "B" foo "A" "B" foo("A", "B") "C" rm function:/foo You may find you get different results than you may first expect. I did. Reference: http://weblogs.asp.net/soev... ...
We're shaking things up a bit over here at NINEQuestions.net. My 32nd cousin (she was born a Williams) and temporary co-host Rachel Appel is turning things around and asking me the questions this time. I'll let her take it from here. When I saw Chris doing the 9 Questions series on his blog, I wondered why everyone else got a little shot at web celeb and not the man himself. So I hopped on IM and said “Hey Chris, you’re interviewing everybody, but where’s your questions and answers? You have to dogfood ...
Update: deadline pushed back (another week?) for the scripting contest. In case you missed it, the guys over at the PowerScripting Podcast are hosting a scripting contest. Hurry though, the deadline is Sunday! They’re giving away free licenses of NetCmdlets and PrimalScript 2007. Technorati Tags: PowerShell, NetCmdlets ...
Murray Gordon (who recently left Charleston to join Microsoft in Atlanta!) told me about an MSDN and TechNet event going on next week in Columbia. See the links below for more info and to register! TechNet: Vista, PowerShell, Group Policy MSDN: WPF, Vista (for Developers), Visual Studio 2008 and Microsoft .NET Framework 3.5 SP1 Enjoy ...
On last week’s PowerScripting Podcast, Jonathan Walz and Hal Rottenberg interview /n software’s Eric Madariaga about NetCmdlets and PowerShellToys (PowerShellASP). My favorite part was when Hal was shocked to hear that a telnet cmdlet was added to the v2 beta. Hahaha. I completely agree – who uses telnet anymore? But that was actually the biggest request we got from people who were using v1 of NetCmdlets! We already had cmdlets for executing commands over ssh…but people really wanted telnet. This ...
Every time I get to a point where I need to commit the code I've been working on (a.k.a 'The Check In Dance'), I typically ALT+Tab over to the explorer window where my source working directory is located. From here I execute our build.bat file that runs the developer build process that compiles the code and runs all the unit and integration tests locally before committing my changes. I'd rather stay in Visual Studio to do this so I Googled for a solution and of course found that some smart person ...
I just had to padd an integer with zeros when I displayed it and thought it would be a good piece of code to post considering there are some crazy difficult versions of doing this on the net that seem quite unnecessary. iNum.ToString("000") This will pad iNum with leading zeros if it's length is smaller than 3. For example, if iNum = 42, the output would be the string "042". HERE's a great MS resource for numerous ways to pad strings including with zeros and blank spaces (it's about padding in PowerShell ...
So you want to determine if a folder or file exists with PowerShell? You can invoke the same scripting object you might remember from VB.... #set a var for the folder you are looking for $folderPath = 'C:\Temp\' #instantiate the FileSystemObject $objFSO = New-Object -ComObject Scripting.FileSystemObject #check to see if it is missing if($objFSO.FileExists($fold... -eq $FALSE)) { echo "The folder does not exist." exit } else { echo "The folder exists." exit } ...
I gotta admit, I really like PowerShell. No, that's not accurate. I love PowerShell. I love PowerShell like babyback ribs love sauce. My relationships with PowerShell has bloomed from piqued interest to full blown infatuation. PowerShell fits the bill of what I look for with tools - not overly engineered, actually useful, lightweight and extensible. But since I have taken such a liking to PowerShell, that makes me wonder...isn't PowerShell supposed to be designed for admins who aren't programmers? ...
I hate when people send me an email with a .rar (or similar non-.zip) attachment. I realize that rar has some special features that set it apart - but those features are not really very important when you're just talking about sending me a small non-commercial c# project in an email. I think I will create my own custom compressed archival format, and start sending out .lnc files (which doesn't stand for "lance", but something creative that implies its the worst compression format ever, like "loco ...
From the work front: What have I been doing at work lately? I’ve been spending a lot of time at work playing with SharePoint, the PowerShellToys’ PowerShellASP which lets you create ASP.NET apps with PowerShell script, and I set myself up with a brand new openSUSE 11 (this is a great distro) machine where I’ve been spending a lot of time in MonoDevelop. Speaking of PowerShell and ASP.NET – check out PoshBoard [at CodePlex], Antoine Habert’s PowerShell driven ajax portal. Antoine has a nice little ...
Classes the week of July 21 at New Horizons of MN New Horizons of MN, located in Edina MN, has the following classes running next week. Most classes are offered either as a public class here at our facility or as a remote class, which is the same instructor led class, but instead of coming in to our office, you take the class from anywhere. For more information on what remote learning is, please visit http://www.nhmn.com/Service... IT Courses 1456AI Citrix Access Suite 4.0: Build/Test ...
Up until now, most of my use of PowerShell has been against SSAS, but I recently had a need to setup a number of SSIS packages for some relatively large CSV files. My problem was that the CSV files had about 125 columns and 120 of them (10 years of monthly figures) need to be inserted into Numeric(18,5) columns in SQL Server. However the connection manager auto-detected these columns on my flat file connection manager as DT_FLOAT. Changing these columns to DT_NUMERIC and setting the scale to 5 quickly ...
Classes next week at New Horizons of MN www.nhmn.com MI3938: Updating your Skills from Microsoft Exchange Server 2000 or Microsoft Exchange Server 2003 to Microsoft Exchange Server 2007 http://www.nhmn.com/Courses... *available as instructor led in our facility or remote learning June 30 - July 2 July 9-11 Sept 10 - 12 November 5-7 PowerShell for Administrators http://www.nhmn.com/Courses... June 30 - July 2 July 23 - 25 August 20 - 22 October 1 - 3 ...
In the past I gave examples of using the get-ftp and send-ftp cmdlets for PowerShell, but recently a user pointed out that I didn’t show any examples of public key authentication using the cmdlets. Of course the –ssh flag tells the get-ftp and send-ftp cmdlets to use SSH (instead of plain text FTP, or an SSL connection which is turned on with the –ssl flag). For SSH connections, the AuthMode parameter determines what type of SSH authentication to perform – in this case that will be “publickey”. The ...
[Source: http://geekswithblogs.net/E... One of the nice advantages of developing on a virtual image is that you can set it up with one drive for the OS and another for data. Your dev toolset is ready for project joiners to use, and copying a 15Gb file is far quicker than installing your toolset from nothing. When you want to take work home or on the train with you, it's just a case of zipping up the 1Gb data drive and copying it to your laptop. I've been doing this using Microsoft Virtual ...
Topic: VSTS Build Deployment with TFS Deployer Date / Time: Wednesday, June 18th @ 5pm Where: Microsoft 8300 Norman Center Dr., Suite 950 Bloomington, MN 55437 Description: TFS Deployer is an open source agent for monitoring TFS builds and automatically deploying them when they are ready for deployment. VSTS does not come with any ‘out of the box’ build deployment and distribution tools. Usually, users either add deployment scripts as part of the build process; create a separate build definition ...
I've been looking for an elegant solution to allowing you to remotely connect to boxes in other domains without a trust in PowerShell. I've Tried: Using the Control Panel User/Password repository to store my credentials on a server by server basis. (this takes a lot of setup and is out of site out of mind). Mapping a null drive with alternate credentails in script. Was anyone seen any other ways of doing this that may be more elegant? Anything that is a "PowerShell native: solution ...
I just uploaded a new YouTube video for RSSBus. Some of it is hard to see, but soon it will be published at rssbus.com as a high quality flash video. RSSBus can be used to securely serve custom feeds over the Internet or on the local host. This video shows examples of very basic feeds that can be created with RSSBus with just a few mouse clicks, and more complex piped feeds. Near the end, the video shows some ways in which RSSBus can be integrated into real world solutions. Obviously, RSSBus can ...
I had a comment recently on one of my older posts that I did about XMLA which asked about listing cubes in a database and whether the cube is processed and it's size. I have posted about a number of different ways of doing this over the last few years, but I thought I would use this opportunity to consolidate a list all the various ways of doing this that I could think of. Under the covers all these techniques are ultimately issuing some sort of XMLA discover against the SSAS database and returning ...
After my last post on how to list the aggregations for a given attribute using Powershell and PowerSSAS, miltruenos commented, asked if it was possible to do a similar script to show roles and allowed/denied sets, so here is just such a script. add-PSSnapin powerSSASnew-PSDrive ssas powerssas localhost $roles = gi "\Databases\Adventure Works DW\" ` | % {$_.Dimensions} ` | % {$_.DimensionPermissions} ` | % {$_.AttributePermissions} ` | add-Member ScriptProperty DimensionName {$this.Parent.Parent.Name}-... ...
If you have ever manually edited aggregation designs, you may have wondered what aggregation currently exist for a particular attribute. Well the following powerSSAS script will give you just that. (you could do this with straight PowerShell, but powerSSAS just makes it slightly easier to address a given measure group) Technically this script is just one single statement, with a couple of parameters to make it more re-usable. I have broken it up in order to make more readable by using the PowerShell ...
OK, So I took over a year break from blogging......I am back....and am looking for your input on what i'll be writing...  I hope to be covering BizTalk, Powershell, IIS, SOA Architecture, and maybe even other things as they come up....Posts coming soon.
Florida has a very active developer community. The biggest problem we seem to have is that all of these different groups usually don't know about each and there hasn't been a "centralized clearinghouse" listing all of the technical communities. Joe Healy, one of our Florida Microsoft Developer Evangelists, maintains a list and earlier this year started putting together one-page flyers for each of the main areas in Florida. I think the eventual plan is that Joe will be updating his site to take advantage ...
I had a question recently about how to quickly convert all the attributes in a given database from UPPER CASE to Title Case. Now you could certainly write a C# or VB.Net based program, but I feel that a script is the way to go for a once off requirement like this and what better scripting environment could we ask for than PowerShell. So here is a short PowerShell script that does the job. [System.Reflection.Assembly... > $null [Microsoft.AnalysisServices... ...
I have a lull at work as it happens every once in a while, so of course you see me post at least once a day. I am kind of ADHD when it comes to having nothing to do at work. Today I went through SharePointFeeds.com about 800 times refreshing the OMEA Reader, looked up some Silverlight creation tools, played around with a few PowerShell Tools, and now I find myself at this blog yet again. I am half waiting for a book proposal to get pushed through a publishing company that contacted me. I just sent ...
Today was .NETwork usergroup second gathering. The usergroup is the first and only large/effective "offline" usergroup in Egypt (although there're many others in INETA). They had a great success in their first gathering when they brought Steven Forte to talk about SQL Server 2008 new features for developers and ASP.NET MVC design pattern. I had a detailed post about it in my GWB blog at that time. Check it out for details. Background: First To Second Gathering (Warning: Boring Part!!) The .NETwork ...