Browsing articles tagged with " script"

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 […]


Exchange 2010 Mailbox report

This is not really that hard, but it’s something many Exchange admins find themselves needing: A script which emails mailbox statistics and a schedule task which fires it offonce a month. Now I did this for a customer with about 200 users, who just wanted some control over the mailbox sizes, as they don’t have any quota on them. For large enterprise environments, this is not necessarily the best solution, but it works. So what […]