Reply To: pssnapin question and OneNote
Hi Joe, OneNote doesn't come with a PowerShell provider. You'll need to install Brian's MSI because snap-ins need to be registered in the Registry unlike modules. Brian's MSI should handle the...
View ArticleReply To: Deleting Old User Profiles
Deleting user profiles is a tricky business. I believe PowerShell is not the right tool for the job. We're using Helge Klein's Delprof2 tool at work which does exactly this job very well without issues.
View ArticleReply To: PSRemoting – PSSessionConfiguration – Using PSSnapin in...
On the other hand, if you create a module of your own $snapin = Get-PSSnapin -Registered WDeploySnapin3.0 Import-Module (Join-Path $snapin.ApplicationBase $snapin.ModuleName) -Verbose...
View ArticleReply To: Event log script help.
Hi Again, I'm still having a lot of trouble with one of these scripts. Now the strange thing is even though the $date variable is used twice this script has been working fine for over a year. It takes...
View ArticleReply To: $Allnodes.foreach examples
thanks Jacob much appreciated, hopefully the example below shows what we are trying to do. At the moment we are using just a standard foreach() statement and just enumerating through the windows...
View ArticleReply To: View Past Powershell Scripts
Thanks Daniel. no shares or repositories and i was hoping to build my code from their examples …. oh well !
View ArticleReply To: passing on variables
thanks very much, i replaced that line with "$pathd = $path -replace $user" and my script works fine, many thanks again
View ArticleExecuting Powershell from C#
I know the C# element of this is OT here but I am at a loss and am hopeful someone with more powershell experience than I may know something. I have tried several ways to loop through some code with...
View ArticleReply To: Executing Powershell from C#
We probably need to see what you've already attempted, but in general, PowerShell is very slow compared to C#. If performance is a concern, since you're in a C# app anyway, you may find that it's...
View ArticleFinding Hyperlinks in word documents then attaching the document
Hey, Im creating a powershell script to search through word documents for hyperlinks. Here is what I would like to achive – Search through the word document Find the hyperlinks obtain the hyperlink...
View ArticleReply To: Adding multiple bindings with xWebAdministration
The below worked for me: $sitename = "MainWebSite" xWebsite MainHTTPWebsite { Ensure = "Present" Name = $sitename ApplicationPool = "MainAppPool" State = "Started" PhysicalPath = "C:\path\to\files"...
View ArticleReply To: Executing Powershell from C#
Hi Dave, I have basically moved the following into and out of the loop that iterates of the data set: Collection<PSObject> results; using (PowerShell powerShell = PowerShell.Create()) { //...
View ArticleReply To: $Allnodes.foreach examples
I will have to test this out and get back to you. What happens when you run this? Do you get a .MOF file, an error message, or something else? I am just wanting to know what kind of behavior you are...
View ArticleReply To: Deleting Old User Profiles
Just so you understand the problem with your script. You are generating a PSObject from Get-WMIObject, so the object doesn't have a .Delete() method (even if it did, it would just manipulate the...
View ArticleReply To: $Allnodes.foreach examples
Alright, it's going to take someone with a much greater understanding of PowerShell than me to tell you how to do this. It is definitely supported, because if you just type Node $AllNodes. you get 2...
View ArticleReply To: Finding Hyperlinks in word documents then attaching the document
Working with Office products using COM+ is an adventure. The good thing is you can get a hint of what you're doing using the macro recorder. Enable the developer tab on the ribbon. Start recording a...
View ArticleReply To: $Allnodes.foreach examples
Basically Is it possible to use the $Allnodes.Foreach() statement in a similar fashion but using the array stored in the hash table key Winfeatures within the configdata and do something like...
View ArticleReply To: Executing Powershell from C#
Well, that's the basics of how to execute PowerShell from within C#. However, if you're doing this millions of times, you may find that it's much faster to run the script once, keep an open runspace,...
View ArticleReply To: Event log script help.
ReplacementStrings: http://msdn.microsoft.com/en-us/library/system.diagnostics.eventlogentry.replacementstrings(v=vs.110).aspx The replacement strings are returned as a array, so the [#] indicates the...
View ArticleReply To: Deleting Old User Profiles
Thx Rob I'm going to check it out ill let you know
View Article