Tag | Powershell Posts

If you want to run a batch (.bat) file from within Visual Studio, you need to add an external tool. From the Tools menu select External Tools, and then click Add. Fill out the values as illustrated below: Click OK to close the dialog. Now you can select the bat file to run in solution explorer, and select the Run Batch File command from the Tools menu. The output of the batch file will be echoed to the output window inside visual studio. <Revised 6/2/10> You can also run .bat files from the ...
Eventually you're going to need to search their source-control for latest changes given some parameters. I recently came across a couple of handy ways to do this, using TFS Powertools (and Powershell). First, ensure you have the latest version of TFS Powertools installed. Also ensure you have included Powershell CmdLets when you install (or make sure this option was enabled if you've already got TFS Powertools installed) To search TFS via the command line, fire up the Powershell window and execute ...
Once you enable the Developer Dashboard in SharePoint 2010. See below for instructions by Jie Li using Powershell or STSADM: STSADM: stsadm -o setproperty -pn developer-dashboard -pv OnDemand Windows PowerShell: $svc=[Microsoft.SharePoint.... $ddsetting=$svc.DeveloperDa... $ddsetting.DisplayLevel=[Mi... $ddsetting.Update() You can write log information out to the Developer Dashboard ...
WOW! Unbelievable stream of goodness coming from Visual Studio ALM Rangers!! Visual Studio 2010 and Team Foundation Server 2010 VM Factory The purpose of this project is to build prescriptive guidance around the virtualization of the Visual Studio 2010 and guidance for full automation of the creation of virtual machines. The goal is to help users with the installation and configuration of virtualized environments with least effort and maximum automation. Visual Studio ALM Rangers This guidance is ...
Thanks to John and the guys at NxtGenUG Southampton for the invitation to come down to and present on Hyper-V for Developers tonight. And thanks to the tips, definitely have new stuff to look into, will look into PowerTab for improving my PowerShell experience (thanks to Rob Cooper aka @robcthegeek). I’ll also take the hint of using a proper ‘Southampton’ image. Next time you’ll have the Titanic as a desktop background instead of the mighty Spitfire whose first test flights were from Eastleigh airport ...
Anybody who uses Twitter has heard of auto-follow services for Twitter. Below is a PowerShell script I used to auto UNfollow. The script goes through the people you're following and eliminates "idle" or "spam" friends. An idle friend is determined by a low friend count or low status count on an account that has been in existance for at least a couple months (configurable). A spam friend is determined by a high friend count but a low follower count (by default, the script uses a 15-1 ratio as the ...
But first, a brief introduction as to what prompted this line of posting. At PDC ‘09 I had the pleasure of making acquaintances with Jon Galloway and Steve Andrews who challenged me to do more than practice & talk with co-workers and put together a talk and the suggested topic for said talk was – functional programming. Well, I’m not quite at the talk stage yet, but figured that the blog format worked as a good starting point. So, what is functional programming? Wikipedia offers the following ...

Just in case you are around... please come to the SQL Saturday in Tampa, FL on Saturday January 23rd. I will be there!!! And many other SQL Server speakers. Visit http://www.sqlsaturday.com/32/eventhome.aspx for more information...

Many topics will be covered including SSIS, ELT, Powershell, SQL Azure,  CTEs, Dashboards, Service Broker and many more!

 

BizTalk Reset Source BizTalk Error Lookup Console 2EPUB - Free tool to convert documents and e-books to EPUB format. 100% free online converter Best Coding Practise KeyLimeTie™ - Twitterizer Simplifies .NET Integration with Twitter PowerShell Provider BizTalk ...
Today I saw this on Twitter from Julie Blender (@#juneb_get_help): Need to reference the "ProgramFiles(x86)" environment variable in #PowerShell? Use ${env:ProgramFiles(x86)}. I use this in a lot of my scripts, but I want a single variable that contains the right value whether I'm in a 64 bit shell or not. Here's my solution: First, I have a function in my testing profile called is64bit, that looks like this: function is64bit() { return ([IntPtr]::Size -eq 8) } Next, I have a get-programfilesdir ...
GeeksWithBlogs.net and other SubText Users: If you are trying to create a new blog post, and you get the following error: Input string was not in a correct format. at System.Text.StringBuilder.F... at System.Text.StringBuilder.A... provider, String format, Object[] args) at Subtext.Framework.Util.KeyW... source, String oldValue, String newValue, Boolean isFormat, Boolean onlyFirstMatch) at Subtext.Framework.Util.KeyW... entry) at Subtext.Framework.Data.Data... ...
Here are a few one-liners that use NetCmdlets. Some of these I've blogged about before, some are new. Let me know if you have questions, which ones you find useful, or how you altered these to suit your own needs. Send email to a list of recipient addresses: import-csv users.csv | % { send-email -to $_.email -from lance@nsoftware.com -subject "Important Email" –message "Hello World!" -server 10.0.1.1 } Show the access control list for a specific Exchange folder: get-imap -server $mymailserver -cred ...
Technorati Tags: Tutorials Team Foundation Server Power Tools 2010 Beta 2 (Free) The following are the Power Tools supported in this release. Team Foundation Server Best Practices Analyzer Check-In Policy Pack Work Item Templates Alert EditorWindows Shell Extension PowerShell Support TFPT Command Line To read more go to the http://visualstudiogallery.... Last Updated: Friday, December 04, 2009 Supported Versions Visual Studio 2010 ...
A while back I posted about how to mark a script parameter as required in PowerShell. Shortly afterwards, there was some chatter on it that I think makes it worthwhile to add another post on the subject of PowerShell script parameters. Let’s say you have the question: “Can I do <X> with a parameter?” The answer is probably “Yes”. :) Jim and an anonymous emailer both asked: Is there any way you can specify a parameter based on the value of another parameter? The answer is yes. You can put pretty ...
So, I finally got around to installing SharePoint 2010! I will get a chance to poke aroudn this week and take a look at the new features and start blogging. I had a couple of issues I thought I would direct people in the right direction. I run all my vm's on Mac OSX, I had to upgrade to Snow leopard which has is an x64 OS and I upgraded my vm version. I actually run Parallel's for Mac. The newest version is version 5. I am not 100% sure but I don't think that creation x64 OS on parallels is a new ...
So I set out on a quest to install a SharePoint 2010 VM with Bob Davis, one of our 101 instructors for SharePoint Saturday Kansas City and a Co-Leader of the KC Office Geeks. We started around 5 pm and ended around 11 pm. Everything that could possible go wrong went wrong in triplicate. Here is a list of things you need to know: Turn on Virtualization in your bios: Bob did not have virtualization turned on in his bios, so the virtual machine I had stubbed out did not work. You need to make sure that ...
[Update: 2009-12-30] We got it working using SSIS. Read this post: http://geekswithblogs.net/L... [Original post] Would love to know if there is a way to kick off a SSRS report and pass some parameters into it via T-SQL or SSIS. Unfortunately, we can't have MS SQL Enterprise edition. Guess this is the true list of possible solutions: VB script PowerShell WMI script batch file T-SQL Sad thing is I know how to make this ...
v\:* {behavior:url(#default#VML);} o\:* {behavior:url(#default#VML);} w\:* {behavior:url(#default#VML);} .shape {behavior:url(#default#VML);} Normal 0 false false false false EN-GB X-NONE X-NONE /* Style Definitions */ table.MsoNormalTable {mso-style-name:"Table Normal"; mso-tstyle-rowband-size:0; mso-tstyle-colband-size:0; mso-style-noshow:yes; mso-style-priority:99; mso-style-qformat:yes; mso-style-parent:""; mso-padding-alt:0cm 5.4pt 0cm 5.4pt; mso-para-margin-top:0cm; mso-para-margin-right:0cm; ...
After reading Tim Anderson’s blog article (here) on his installation of Hyper-V Server 2008 R2 I glibly added a comment that R2 now includes PowerShell 2.0 for local management of virtual machines using PowerShell scripts. Of course, I hadn’t actually tried this before commenting .... Why would you want to use scripting on Hyper-V Server 2008 R2 If you have never installed Hyper-V Server 2008 R2 you may not realise the limited options provided by the local management tool. Based on Windows Server ...
Presenters: Simon Skaria and Umesh Unnikrishnan This was my second session during the week. It was one in which my hopes were that they would talk about the deployment differences that SharePoint 2010 would have over 2007. I was not disappointed. So to sum it up a bit: 2010 has a much more flexible model compared to 2007. Improved security model Claims Based Authorization/SAML Better administration with Central Administration and also PowerShell Service Isolation Now the Services that you deployed ...
This post is the eighth in a series of postings, containing examples of SharePoint WebParts that anybody can build all by themselves. To read all posts in this series, or to get started with the RSSBus WebPart, go here. #8 – Twitter Many times since I originally posted about it months ago, I’ve been asked for more details about including Twitter searches and streams inside their SharePoint pages. Thanks to the Twitter API and feeds, this is very simple to do, and to change from showing searches, ...
I’ve talked about this before, but it came up again today so I thought I’d do a quick post about it. Here’s a function I use in my PowerShell profile that uses NetCmdlets to send quick “todo” emails: function todo($target="work", $msg) { switch ($target) { "work" { $target = "lancer@nsoftware.com" } "home" { $target = "lmrobins@gmail.com" } } send-email -from lancer@nsoftware.com -to $target -subject ("Todo: " + $msg) -message $msg -server 10.0.1.1} During the day, when I need to send myself a reminder, ...
The October Service Update for Microsoft Online Services includes several new features and enhancements designed to improve the service experience for both administrators and users. The Service Update is currently being deployed into production data centers. Many of these service enhancements are the result of customer and partner feedback. The following features and capabilities are included in the October Service Update: Bulk Activation of Users PowerShell commandlets will be added to streamline ...
There was a question the other day on the MSDN SSAS forum asking how to find out the Edition of SSAS which is running on a given server. The answer to this question could be either Standard, Enterprise or Developer. The Object Explorer in Management Studio displays the current version next to the server name, but not the Edition. Now at a basic level I know that this is stored as a property of the server, so you could run a DISCOVER_XML_METADATA command like the following. <Discover xmlns="urn:schemas-microsof... ...
I have been working in Selenium (see previous posts) building a test suite at my job. I spent quite a bit of time architecting the design and attempting to build bricks with which others could build buildings. I was beginning to instruct the folks on my team (who had not previously written code) on how to use these bricks and understand the mortar. This all in a language (Java) with which I wasn't terribly familiar. The framework design was sound and was beginning to grow on it's own. Then, the massive ...
NEW MSDN and TechNet Firestarter session recordings are now available on demand! Download the Silverlight Firestarter technical sessions - With Scott Guthrie leading the roster of presenters, learn what's new and noteworthy in the latest releases of Silverlight and Expression® 3 along with a rundown on .NET RIA services, toolkit, and more. Download the Windows Firestarter technical sessions - This Windows Firestarter introduces and deep dives into DirectAccess, Group Policy and PowerShell, Internet ...
Thanks to Ray and Gavin for organising another top EdgeUG meeting in Microsoft Cardinal Place and for everyone who attended my talk on Hyper-V for Developers. The audience had to deal with a huge amount of technical information that I crammed into the hour - hopefully it didn't put them off their pizza. Fortunately the Stack Overflow master and author of C# in Depth, Jon Skeet, was on hand after the break for a interesting glimpse into code contracts coming with VS2010 and C# 4.0. For those who weren't ...
One of the new features of the BizTalk Build Generator is a provider pattern for the build script generation. This means if you prefer to use a different format/structure in your build scripts or even don't like MsBuild and would rather use NANT, Powershell or traditional batch scripts then you could create your own provider which would take advantage of the metadata used by the BizTalk Build Generator and then produce scripts in your own format. In order to create your own provider you must create ...
For clarity it is best to start with what a filter is and relate it to a function. So here are both descriptions: Function: A function is a named sequential set of Powershell commands grouped into a code block that my be called once or many times by its name from anywhere in the rest of the script. Filter: A filter is similar to a function but is used in an entirely different manner. A filter is an output target for a pipeline and its job is to filter and then present that data. Filter Syntax: Filter(Keyword) ...
On a recent project I needed to test my application with lots of data so I remembered my good friend the Faker Gem from the Ruby world. I didn’t know how to connect ActiveRecord to SQL Server, so I searched the webs and found this article by Ray Houston at Los Techies. Unfortunately since the article was 13 months old, the Ruby libraries have evolved to not work that way anymore :) So after some head scratching I got it to work again. How to connect ActiveRecord to SQL Server If you don’t have Ruby ...
Historically I have always viewed ASP.NET session state as “pure evil.” In-proc session state is about as unreliable as you can get given that you can have timeouts, ASP.NET might recycle itself, IIS might get bounced, no scalability, and cannot work in a web farm. SQL Session state is very resilient and works in web farm scenarios but the performance is not good and at that point you might as well be better off writing your own strongly-typed data access layer rather than blobbing everything in ...
Thanks to Alex and Matt for organising another top DevEvening user group in Woking and for everyone who attended my talk on Hyper-V for Developers. Apologies for over running and hope it didn't stop you from enjoying your meals. I think I achieved a good warm up for Sebastien Lambla's talk on best practices in MVC. For those who weren't there last night, the presentation provides an overview of Hyper-V Server 2008 and Windows Server 2008 running Hyper-V, tools that you can install to help you out, ...
I’m a huge fan of StExBar. I posted about it awhile back and have since found more reasons to think this is a must have tool! It’s got an ability to give you great shortcuts at your keyboard finger tips. How often have you been like “I need a command window here” and then went through a bunch of trouble to get it there? How about {Control} + {M}? BAM! Command Window opened and pointed to that directory. I’ve been starting to use PowerShell more and I thought…hmmm – I could add PowerShell to this ...
Came across this FREE eBook the other day. Definitely going into my Reference material folder. Almost every project involves some management activities where scripting is required. However, I’ve not invested enough in PowerShell (learn as I go). This eBook looks like a good general reference and the price is right. Technorati Tags: PowerShell ...
Well, the hayfever has got me again! Here I am at 6am with a bunged up nose and itchy eyes wide awake. So I thought I would do the sensible thing and give you a heads up on what’s due in the next release of SAF. Here’s the Feature list : New Actions STSAdm Action. This allows us to call STSAdm commands and pass arguments from a SAF Macro. Powershell Action. Allows us to to call Powershell “Function” and pass arguments from a SAF Macro. Adapters In SAF, we think of “Adapters” as being components that ...
Looking for something to do this weekend? Looking to master PowerShell? Windows PowerShell MVP Dr. Tobias Weltner has released a free book just for you, Mastering Powershell! This isn’t a little cheatsheet; it’s 567 pages long. Here’s a linked chapter list if you want to jump directly into a topic. Chapter 1. The PowerShell Console Chapter 2. Interactive PowerShell Chapter 3. Variables Chapter 4. Arrays and Hashtables Chapter 5. The PowerShell Pipeline Chapter 6. Using Objects Chapter 7. Conditions ...
I recently wrote a Windows service for the development team here at work. Apparently, the devs were all committed to other projects and this extra curricular activity popped up. Being a developer in tester's clothing, I was asked if I'd do it. Interestingly, this was originally to be a Powershell script, but the more I worked on it the less it sounded like PS and the more it sounded like a service...pretty straight forward stuff: comes alive at configurable times, looks for files in a folder, processes ...
As a developer / administrator, I'm always on the look out for tools to help me do my job. Power shell is just that. I don't think we've seen the impact of the product yet. When the light bulb goes off in more peoples heads as to just how innovative Power shell is, I think we'll see more interest. I've recently picked up the following books on Power Shell: Windows PowerShell in Action by Bruce Payette Professional Window PowerShell by Andrew Watt Windows PeowerShell Pocket Reference by Lee Holmes ...
There was a question in the SSAS forum recently on how to replace one group name with another within the membership of a number of SSAS roles in a number of databases. While you could possibly do this with XMLA it would be tricky as you have to re-submit the whole membership list, you can't just add/remove single members. The easiest way to do this is to write something using the AMO library and in my opinion the easiest way to write a script for AMO is using Powershell. Below is my short script ...
[Source: http://geekswithblogs.net/E... Often in BizTalk deployments you need to do additional work after installation. Typically your full install process may need to: Install BizTalk artifact assemblies to the GAC Install application dependencies to the GAC Register an application source name in the registry, for logging to the Event Log Create FILE send or receive locations on the local filesystem Add application store configuration settings to Enterprise Single Sign-On (SSO) Add log4net ...
You can manage user permissions in Exchange and other mail servers with the same commands by using the IMAP protocol instead of server-specific tools. Here is how! Jumping right in, these all use get-imap and set-imap from NetCmdlets: #1 – Get ACL Here’s a one-liner to get the ACL for a specific folder in an account. In this particular case, my main INBOX has a subfolder named RESUMES, and I want to see who has what permissions to this folder. PS C:\> get-imap -server $mymailserver -cred $mycred ...
Here is a PowerScript function to automate the process of getting/logging the current number of connections to a particular Web Server. It will tell you the number of connections for each site on the server, so you can see the number of SharePoint connections, SharePoint Central Admin connections, etc. Thanks to MOW and Lee Holmes for their examples of using the PerformanceCounter class in PowerShell. function Get-WebServiceConnections(){ $results = @{} $perfmon = new-object System.Diagnostics.Performa... ...
[Source: http://geekswithblogs.net/E... The sample BizTalk application provided with the BizTalk Cache Adapter on CodePlex illustrates three approaches for using the cache: Simple Messaging – routes all messages configured for caching to the cache adapter, and sends cache-misses on to the service provider; Orchestration – explicitly routes messages to either the cache adapter or service provider in orchestration logic; Complex Messaging – routes messages configured for caching either to ...
I find that helping people troubleshoot FTP connectivity issues is much easier if they have PowerShell installed. I can just have them run the NetCmdlets ftp cmdlets with the –debug switch, which displays a trail of information about the communication over the wire. In this way you can see every command send to the server and every response coming back from the server, including what ports a server is attempting to use for ftp data connections. Very often ftp transfer connectivity errors are the ...
Available immediately from Code Gallery, download the Windows Azure MMC. The Windows Azure Management Tool was created to manage your storage accounts in Windows Azure and makes it simple to help debug, create, and explore your storage solutions. In our testing, this tool has been invaluable to us to inspect messages in our queues. debug, create, explore… Developed as a managed MMC, the tool allows you to create and manage both blobs and queues. Easily create and manage containers, blobs, and permissions. ...
I'm beginning to write simple scripts in powershell. One of the things items that really isn't straight forward is the write-output command. At first glance, one would think that this would simply output a string. Well, there is a trick I found. PS>write-output xxxxxxxx yyyyyyyyy really outputs xxxxxxxx yyyyyyyyy PS>write-output "xxxxxxxx yyyyyyyyy" really outputs xxxxxxxx yyyyyyyyy PS> $A = 10 PS>$B = 20 PS>write-output "A = $A B = $B" really outputs A = 10 B = 20 ...
I am happy to announce that we recently put out a new release of BIDS Helper. I have copied the release notes out below, but one important "feature" that is not listed is that we now have a build script which is a modified version of the psake Powershell build script written by James Kovacs. It had gotten to the point where it was a bit of an effort to do a build. You had to start by making sure you had the latest version of the source code, then version number had to be updated in a number of spots, ...
The new site for the Belgian Community Day 09 is open. “Eleven Microsoft User Groups combine their efforts to organize this unique networking and knowledge sharing event. A unique opportunity to learn about Microsoft’s latest developments and technologies like Exchange 2010, Silverlight 3, Visual Studio 2010, SQL Server 2008, Windows 2008R2, Powershell V2, Forefront Identity Manager 2010, XNA 3.1. and OCS R2. Microsoft Community Day will take place on Thursday 25th June 2009 in Utopolis, Mechelen, ...
Recently I saw a question come to my friend Spencer here at /n software about whether or not it was possible to use the Microsoft Exchange 2007 SP1 PowerShell cmdlets through the /n software PowerShell Server. The person wanted to be able to manage Exchange from a remote Unix machine. Of course, as I’ve mentioned before, it could be done from anywhere that supports SSH – like an Apple iPhone or a Blackberry. The PowerShell server uses impersonation - it impersonates the user that the SSH client authenticated ...
In a previous post, I talked about how PowerShellASP can be used to generate an RSS feed with PowerShell. Now I’ll show how the same feed can be generated more easily with PowerShellRSS. Again, the dir command in PowerShell (get-childitem) is used to get a listing of files to use as enclosures in the feed. # This example demonstrates how to generate an RSS feed from a call to the Get-ChildItem cmdlet (dir). # To tailor to your specific needs, set the following values: $mediadir = 'C:\Testing\media';$virtual... ...