Waclaw Chrabaszcz
... there is no spoon ...

PowerShell

Easter egg – OMG^2 the true PowerShell in bash window

Let's continue this crazy experiment. More or less it should works on any distro in my case it is Ubuntu 13. The idea is to use wine (Wine Is Not an Emulator J) to install Powershell 2.0 for Windows XP. Wine can emulate W7 or W8 however it refuses to install .MSU packages. To reach our goal we will need to use experimental wine 1.7 or above and EXE file so … For the science!!! sudo add-apt-repository ppa:ubuntu-wine/ppasudo apt-get updatesudo apt-get install wine1.7 winetrickswget http://kegel.com/wine/winet... ......

SCOM 2012 R2 – How to put servers into Maintenece mode using PowerShell

In more or less ITIL's world you have to monitor availability and performance of your servers. However from time to time you need to apply approved changes, what means temporary unavailability or performance degradation. When we talk about Worldwide organizations, in many cases it is really hard to inform everyone about upcoming changes. Sometimes you don't want to inform anyone, you just don't want to wake up your colleagues at 2:00 AM their local time. So to apply the change in elegant way let's ......

Active Directory – How to promote Server 2012 R2 to DC and even more using PowerShell magic

It will be quick post, I have limited access to the Internet. Today we are going to promote Windows 2012 to Domain controller and move some unique roles to it. It can be handy in DR scenario, or when we are going to raise domain functional level. It is very easy task, so to make some fun I'm not going to touch a GUI. Prepare AD forest for Server 2012 if it is needed. Of course as a Schema Admin, of course it is one way ticket, so think twice before you do anything.Don't forget about backing up your ......

OMG!!! A PowerSHELL within the bash console!

Each year during last days of the calendar year most of corporations enters into change freeze mode. During these days IT pros have to do … nothing J ! This is an example, how these stories usually ends .. I don't like to wear a hat, especially red, so my favorite penguin is named Ubuntu. I found nice .DEB package named winexe http://download.opensuse.or... After the installation we have access to new command, let's test how it works in "practice" ......

SCCM2012 R2 – How to schedule collection refresh interval using PowerShell

There was an open subject after my first post about scripting ConfigMgr. In the meantime I've migrated from SCCM 2012 SP1 to R2, so I am really not sure whether this commandlet works for legacy versions. Here's the good example how to use schedule token while you are creating a device collection. $schedule = New-CMSchedule –RecurInterval Days –RecurCount 1New-CMDeviceCollection -Name testDevCol -LimitToCollectionName "All systems" –RefreshSchedule $ScheduleAdd-CMDeviceCollec... ......

PowerShell – The first kiss with VMware PowerCLI

Long time ago VMware published they own PowerShell module. Let's take a look on it. First we need to download and install the module.https://my.vmware.co... It is a really simple Next, Next installation, and it creates a shortcut on your desktop. Here you have few simple examples. #add ESXi host$myServer="localhost"$M... = "192.168.1.10"$myLocation = "Cluster1"$MyUsername = "root"$MyPassword = "Password1"Add-VMHost -Server $myServer ......

How to install Windows Server features using PowerShell – Server 2012 R2 update

I have some feedback that list of roles and features is obsolete in my old post. Let's learn than how to have always up to date list. First things are first, to install some role or feature use followed command: Install-WindowsFeature -Name Web-Server -IncludeAllSubFeature Let's act as TRUE admin: $servers = ('server1', 'server2') foreach ($server in $servers) {Install-WindowsFeature –ConfigurationFilePath D:\ConfigurationFiles\ADCSC... -ComputerName $server} How to generate up to date ......

XenDesktop 7 – The QFARM /LOAD case

For XenApp admin live without QFARM is like live without right hand. Of course you can obtain required information using the PowerShell, but XenDesktop 7's command line is too long to remember and type. Let's make some sweet alias. Add-PSSnapin citrix.*set-alias qfarm Qfarm-Loadfunction Qfarm-Load {Get-BrokerMachine -SessionSupport MultiSession -Property dnsName,loadIndex,SessionCo... Of course you'll need to update your personal ENV to start this alias automatically ......

SCVMM – Round 2 – How to create a Private Cloud using PowerShell

Have you ever seen "A Bridge too far" movie? To not to wake up a click too far, it is good to script some tasks. Yes of course we can follow wizards, but some of us want to be warriorsJ. A small tip, take a look on credentials and system GUID examples. I don't know how about you, but for me it will be really useful in the future. # credents$credential = Get-CredentialNew-SCRunAsAc... -Name "TESTDOMAIN\Administrator" -Credential $credential #storage $opsMgrServerCredential = Get-SCRunAsAccount -Name ......

XenApp 6.5 – How to create and set a Policy using PowerShell

Here is my homework Add-PSSnapin -name Citrix.Common.* -ErrorAction SilentlyContinueNew-Item LocalFarmGpo:\User\MyPolicycd LocalFarmGpo:\User\MyPolicy... .\MinimumEncryptionLevel State EnabledSet-ItemProperty .\MinimumEncryptionLevel Value Bits128cd LocalFarmGpo:\User\MyPolicy... -Name "All Servers" -Value "All Servers"Set-ItemProperty LocalFarmGpo:\User\MyPolicy -Name Priority -Value 2 So cute … ......

Full PowerShell Archive