Deleting Old User Profiles
I would like to delete any user profiles older than 30 days prior to backing up a client system. I am getting an access denied when trying to remove the c:\users\jsmith\AppData\Local\Application Data'...
View ArticleReply To: Deleting Old User Profiles
If you are using Windows Vista or higher, and Server 2008R2 or up, you can do it like this: ( Get-WmiObject -Class Win32_UserProfile | Where-Object { $_.LocalPath -eq 'c:\users\user' } ).Delete()...
View ArticleReply To: PSRemoting – PSSessionConfiguration – Using PSSnapin in...
As mentioned in my original post: I have been able to work around this by specifying a ScriptsToProcess entry, which just did an Add-PSSnapin of the needed snap in. So, if an Add-PSSnapin...
View ArticleReply To: Add commands from non-local modules to ISE
Cheers Dave, I've heard of PowerShell Studio of course, but haven't tried it out yet. May be time to look at the free trial. Kieran.
View ArticleMicrosoft.Exchange.Management.PowerShell.E2010
Hi I can use Microsoft.Exchange.Management.PowerShell.E2010 from the Exchange server to create a mailcontact, but when I do the same from another server with the exchange toolkit loaded I get no...
View ArticleReply To: Microsoft.Exchange.Management.PowerShell.E2010
your versions of powershell the same on both the servers ? are both servers the same OS ? Sometimes some functionality is lost when they are not the same OS and powershell version
View ArticleReply To: Add commands from non-local modules to ISE
On your laptop, in Powershell or ISE, type in: Get-Module -ListAvailable That shows you the modules available on your machine. It may look like: Directory: C:\Program Files\WindowsPowerShell\Modules...
View ArticleHaving problems grasping error handling.
Hello, I am new to powershell, scripting, coding etc. Went through the gambit of jumpstart video's and have been reading through online articles/examples and have been making steady progress but I am...
View ArticleReply To: Having problems grasping error handling.
$ErrorActionPreference= "Stop" does exactly what it says – it stops execution. Any time a try block fails you will hit the catch block. Your catch block list out the error. There's nothing else to do...
View ArticleReply To: Having problems grasping error handling.
Thanks, I have the registry actions working. And I could have even cheesed it by increasing my else chain but then it would "try to connect" 4 times and then print out an invalid message for a...
View ArticleReply To: If statement with -and Never worked [SOLVED]
Thanks guys so much for you replies I will check all of these stuff and will get back to you by the results. Appreciate your help so much.
View Articlepssnapin question and OneNote
hello, I have been trying to get Brian Dewey's OneNote Provider to work (http://bdewey.com/2007/07/18/onenote-powershell-provider/). When I run the Enable-OneNote.ps1, I get a message that " No...
View ArticleReply To: If statement with -and Never worked [SOLVED]
Daniel Krebs Mate you are a legend I never noticed the space between the (Enterprise and ") I didn't try the trim one because adding the space sorted out the problem am still thinking how did you even...
View ArticleReply To: Managing Hostnames vs. GUIDs on a Pull Server
The approach I'm taking is to query the server's LCM directly when I run the DSC configuration script to generate a MOF. I'm setting a parameter that expects a computer name when the configuration...
View Article$Allnodes.foreach examples
Does anyone have an example of how to use the $AllNodes.Foreach expression in the configuration data as I ve tried numerous attempts to get this to work with no success to date thanks Glenn
View ArticleSend-MailMessage encoding issue in Powershell 4.0
Hey, hope someone can give me some advice on a weird issue i've encountered. I'm trying to send emails that contains swedish symbols using send-mailmessage in powershell 4.0. This works as intended...
View ArticleReply To: View Past Powershell Scripts
Hello Matt, If the other admins haven't saved the scripts locally on any of the Exchange servers, their workstations, a share, a code repository, etc. than you won't be able to retrieve previously...
View ArticleReply To: PSRemoting – PSSessionConfiguration – Using PSSnapin in...
Right, I didn't notice the last line you put there. I get that the documentation says By default, only the Microsoft.PowerShell.Core snap-in is imported into remote sessions, but unless the cmdlets...
View Article