The recording, slides and demo script from yesterday’s PowerShell and Active Directory session can be found here: https://skydrive.live.com/?cid=43cfa46a74cf3e96#cid=43CFA46A74CF3E96&id=43CFA46A74CF3E96%2140563
Archive for January, 2013
PowerShell and Active Directory recording
Posted by: richardsiddaway | January 30, 2013 | No Comment |The sixth in the series of articles on PowerShell workflows that are appearing on the Scripting Guy blog has been published. The articles in the series that have been published are: http://blogs.technet.com/b/heyscriptingguy/archive/2012/12/26/powershell-workflows-the-basics.aspx http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/02/powershell-workflows-restrictions.aspx http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/09/powershell-workflows-nesting.aspx http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/16/powershell-workflows-job-engine.aspx http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/23/powershell-workflows-restarting-the-computer.aspx http://blogs.technet.com/b/heyscriptingguy/archive/2013/01/30/powershell-workflows-using-parameters.aspx Look for the next article in one weeks time. Until then Enjoy!
PowerShell and Active Directory–reminder
Posted by: richardsiddaway | January 28, 2013 | No Comment |Quick reminder for tomorrow’s session from the UK PowerShell group. Details from: http://msmvps.com/blogs/richardsiddaway/archive/2013/01/16/uk-powershell-group-29-january-2013.aspx
A question came up about piping between advanced functions. The input to the second function might be an array. To illustrate how this works imagine a function that gets disk information – or better still use this one. function get-mydisk{ [CmdletBinding()] param ( [string]$computername="$env:COMPUTERNAME" ) BEGIN{}#begin PROCESS{ Get-WmiObject -Class Win32_LogicalDisk -ComputerName $computername | foreach { […]
My test environment usually has a dozen or so machines at any one time. Some of these are short lived and used for a particular piece of testing – others are kept for years. I decided that I wanted to keep up to date on the patching of these virtual machines so installed WSUS on […]
Ok the embarrassing moral of this story is that you shouldn’t answer questions in a hurry at the end of the evening. 5 minutes after shutting down I realised that there is a far, far simpler way to get the info. Win32_AccountSID is a WMI linking class. It links Win32_SystemAccount and Win32_SID classes. Get-WmiObject -Class […]
I realised there is an easier way to get the data function get-SID { param ( [string]$computername = $env:COMPUTERNAME ) Get-WmiObject -Class Win32_AccountSID -ComputerName $computername | foreach { $exp = "[wmi]’" + $($_.Element) + "’" Invoke-Expression -Command $exp | select Domain, Name, SID, LocalAccount } } Use the wmi type accelerator with the path from […]
A question asked about passing a function name into another function which then called the function. It sounds worse than it is. if you need to pass the name of a command and then call it try using invoke-expression function ffour { Get-Random } function fthree { Get-Date } function ftwo { param( [string]$fname ) […]
A question on the forum asked about finding the accounts and SIDs on the local machine. function get-SID { param ( [string]$computername = $env:COMPUTERNAME ) Get-WmiObject -Class Win32_AccountSID -ComputerName $computername | foreach { $da = (($_.Element).Split(".")[1]).Split(",") $sid = ($_.Setting -split "=")[1] -replace ‘"’,” $props = [ordered]@{ Domain = ($da[0] -split "=")[1] -replace ‘"’,” Account = […]
When: Tuesday, Jan 29, 2013 7:30 PM (GMT)Where: virtual *~*~*~*~*~*~*~*~*~* Active Directory is one of the commonest automation targets for administrators. This session will covert the basics of automating your AD admin – scripts and the Microsoft cmdlets. The new features in PowerShell for Windows 2012 AD will also be covered Notes Richard Siddaway has […]
Categories
- .NET
- Active Directory
- Architecture
- Azure
- Bash
- BITS
- Books
- CDXML
- CIM
- Cloud
- COM
- Containers
- Deep Dive
- Desired State Configuration
- DevOps
- DHCP
- DNS
- DSC
- European Summit
- Events
- Exchange
- File System
- Firewall
- General
- General IT Matters
- Hyper-V
- IIS
- Infrastructure
- IT Community
- IT Security
- Learning PowerShell
- Linux
- Math
- Microsoft
- Modules
- Nano Server
- Networking
- Office 2010
- Office 2013
- Open Source
- Opinion
- Outlook
- Philosophy
- PowerShell
- PowerShell 7
- PowerShell and .NET
- PowerShell and Active Directory
- PowerShell and CIM
- PowerShell and Exchange 2007
- PowerShell and IIS
- PowerShell and SQL Server
- PowerShell and WMI
- PowerShell Basics
- PowerShell original
- PowerShell Summit
- PowerShell User Group
- PowerShell User Group 2
- PowerShell v2
- PowerShell V3
- PowerShell v4
- PowerShell v5
- PowerShell v6
- PowerShell.org
- PowerShellGet
- PowerShellV2
- PSAM
- Rant
- Registry
- Scripting
- Scripting Games
- Scripting Games 2104
- Security
- SQL Server
- Storage
- Strings
- Summit
- Technology
- Uncategorized
- Virtualization
- Windows 10
- Windows 2012 R2
- Windows 7
- Windows 8
- Windows 8 Server
- Windows 8.1
- Windows Server
- Windows server 1709
- Windows Server 2008
- Windows Server 2008 R2
- Windows Server 2012
- Windows Server 2012 R2
- Windows Server 2016
- Windows Server 2019
- WMFv5
- WPF
- WSUS