cat brain | grep interesting >> blog

  • Archive
  • RSS

line editing tricks and shortcuts for powershell

I’ve been using PowerShell for a couple years now and I didn’t know hitting Esc cleared the current line…

    • #powershell
    • #psh
    • #windows
    • #tips and tricks
  • 2 weeks ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

export and import ou's and users from ad

Perfect for setting up a lab.

    • #Active Directory
    • #handy
    • #windows
  • 2 weeks ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

install any version of vsphere client on win8

    • #windows
    • #win8
    • #vmware
    • #nice
  • 1 month ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

change win7 explorer default view to my computer

This always bugged me but it’s taken me this long to actually google how to fix it…

    • #Windows
    • #annoying
    • #hurrrr
  • 1 month ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

change windows server edition with dism

    • #windows
    • #licensing
  • 2 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

spiceworks - free monitoring and alerting for windows and linux

How am I just now discovering Spiceworks?  This is amazing, can’t believe it’s free*.

*they do collect info/data but it’s supposedly anonymized

    • #monitoring
    • #windows
    • #linux
    • #free
    • #awesome
    • #spiceworks
  • 2 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

change time zone for all computers in an ou with powershell

Here’s a little PowerShell script you can use to change the time zone for all computers in a certain OU.

Start-Transcript

Import-Module ActiveDirectory

$cred = Get-Credential

$arr = Get-ADComputer -SearchBase ‘OU=Servers,OU=example,dc=blah,dc=com’ -Filter ‘*’ | Select-Object -ExpandProperty Name

#for debugging - manually set the array for testing

#$arr = “server01”, “server02”

foreach ($a in $arr)

{

Write $a

Write “current time zone is”

invoke-command -cn $a -cred $cred {tzutil /g}

Write “———————”

Write “overwriting time zone”

invoke-command -cn $a -cred $cred {tzutil /s “Central Standard Time”}

Write “———————”

}

Stop-Transcript

    • #powershell
    • #psh
    • #windows
    • #ad
  • 2 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

vmware file level restores with netapp datastores

Works great for Windows MBR disks, but not so much for GPT disks.  Anyone have a solution for GPT disks?

    • #windows
    • #netapp
    • #vmware
    • #gpt
    • #mbr
    • #vmdk
    • #snapshots
  • 2 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

add users to a group based on an ad attribute

Props to TechNet forums user philldogger for this one.  If you want to build a group in AD based on the value of an attribute that the users will have (e.g. make a DFS group based on Department) you can do this:

Import-Module ActiveDirectory

Get-ADUser -filter{department -like “Accounting”} | %{Add-ADGroupMember dfs_dept_Accounting $_.SamAccountName}

In this example I am specifying the “department” AD attribute and looking for anyone who’s Department is set to “Accounting” and adding them to my AD group named “dfs_dept_Accounting”.  

If you want to script it so the group membership is updated as new people join, add this line below the importing of the AD PowerShell module.

Get-ADGroupMember dfs_dept_Accounting | %{remove-adgroupmember dfs_dept_Accounting $_.SamAccountName -Confirm:$false}

This will wipe out the group and then re-add everyone.  You can have one script per group you’d like to be updated, or combine multiple into one script.  Fair warning though, if you have a good sized AD the script’s could take a long time to run and may hammer your DC’s so do due diligence.

    • #windows
    • #powershell
    • #psh
    • #Active Directory
    • #AD
  • 2 months ago
  • 1
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+

wpkg - free software deployment and management for windows

Haven’t tried it out yet but this looks really handy.

    • #windows
    • #config management
    • #cool tools
  • 2 months ago
  • Comments
  • Permalink
Share

Short URL

TwitterFacebookPinterestGoogle+
Page 1 of 4
← Newer • Older →
My name's Josh and I'm a SysAdmin. I post stuff that I think will be helpful to others.

My opinions/posts on my blog and Twitter are my own and do not reflect the views of my current or former employer(s).

The Twitters

loading tweets…

  • RSS
  • Random
  • Archive
  • Mobile
Effector Theme by Pixel Union