Browsing articles tagged with " Powershell"

Enabling impersonation in Exchange 2010

There are a bajillion blogs about this, but there’s also alot of wishy-washy stuff around it. So I figured it might be worthwhile condensing it all down to what you really want to know. The scenario is this: You have an application (in this case Dynamics CRM), which connects to EWS and wants to use a service user to interact with mailboxes. In 2007 you’d have to grant rights; but that is, frankly awful to […]


Microsoft SQL Server 2008 R2 BPA — Error 1722

A bit of a head-scratcher when trying to install the SQL Server 2008 R2 Best Practice Analyzer. The Baseline configuration analyzer installed just fine, and WinRM / PS2.0 was installed, so no prereqs were missing. However, when running the BPA installer, it would just flash a powershell window and fail. I could run msiexec /i {MSI} SKIPCA=1 to install it, but it wouldn’t initiate. A little bit of digging led me to enable-psremoting cmdlet, which failed […]


Clean up Java versions – Updated!

REVISED 11/03/13! I’m not alone in having a headache whenever there’s a new Java-version. The old one doesn’t uninstall, the new one might fail to install. It’s a mess more often than not. After spending some time trying to find a good way to clean it all up in an enterprise environment, I decided that there wasn’t a good solution. So, I decided to invent the wheel myself. The result is a powershell script which […]


Move inactive computer objects

Needed to do some AD cleaning; and obviously Powershell is the way to go. Did some digging around the web and found misc ways to do it; but ended up with this script: $time=[DateTime]::Now.AddDays(-90) $targetOU=(distinguished name for OU) $oldcomputers = Get-ADComputer -Filter * -Properties lastlogontimestamp,objectguid | where {(([DateTime]::FromFileTime($_.lastlogontimestamp) – ([system.datetime]$time)).totaldays) -lt 0 } $oldcomputers | foreach {Move-ADObject -identity $_.objectguid -TargetPath $targetOU} I had some initial troubles, since I tried using distinguishedname, which gave me all […]


“The trust relationship between this workstation and the primary domain failed”

So this isn’t really a new problem, but in Windows 7 it’s become more frequent it seems. It can happen for a number of reasons, but often it’s related to a time-skew between the domain controller and the workstation. Certain computer models seem to be more prone to this than others, though I don’t have any data on that, just my experience. Regardless. You get this: …and you don’t want it. You could log in […]


Set default Calendar Permissions in Exchange 2010

So this is a common request: you need to set calendar permissions for all your users, so they all share details, beyond simple free/busy. Not really a problem, but I’ll save you the bother of reinventing the wheel. Here’s a script which does just that: $mailboxes = get-mailbox $mailboxes | foreach { $user=$_.Alias $path=$user+”:\Calendar” Set-MailboxFolderPermission –identity $path -User Default -Accessrights LimitedDetails } Now, keep in mind the following: This is for ALL mailboxes. Users should […]


XenDesktop – No items match the supplied pattern

So this was driving me nuts for a while. I was trying a simple task: Setting the power scheme for a XD pool. Should be straight forward, but it kepts failing, giving me “No items match the supplied pattern”. Now luckily it’s powershell based (yay!), so it’s solvable. And seing as this isn’t something I change that often, I’m not going to be digging for the answer as to WHY this happens. For some reason […]