Pages

Sunday, July 3, 2016

Uninstall an application from PowerShell–Example Windows Live Essential

I was trying to see an option to uninstall and application from the PowerShell after couple of try I got through.

1. Run PowerShell as administrator

2. Get the status of installation, in this example we are trying to check status of Windows Live Essentials installation so enter as,

“Get-WmiObject -Class win32_product | where { $_.Name -like "*Windows Live Essentials*"}”

clip_image001

3. Store the current installation status to a variable, this example ‘$Software’ is the variable
“$software = Get-WmiObject -Class win32_product | where { $_.Name -like "*Windows Live Essentials*"}”

clip_image002

4. Run “$software.Uninstall()” to un install

clip_image004

5. Execute the step 2 to see the status again

Friday, July 1, 2016

Error while running a PowerShell script with 'curl'

This week I was working on a script to back-up a Audiocodes gateway, while running the script I got below error and it took a day of mine to troubleshooting the issue.

Invoke-WebRequest : Cannot bind parameter 'WebSession'. Cannot convert the "%{http_code}" value of type "System.String" to type "Microsoft.PowerShell.Commands.WebRequestSession".At C:\scripts\Untitled4.ps1:20 char:50+ $statuscode = curl -o null.txt $loginurl -w '%{http_code}'+ ~~~~~~~~~~~~~~+ CategoryInfo : InvalidArgument: (:) [Invoke-WebRequest], ParameterBindingException+ FullyQualifiedErrorId : CannotConvertArgumentNoMessage,Microsoft.PowerShell.Commands.InvokeWebRequestCommand

clip_image001

Solution which worked for me

After digging lot into the issue came to know that the issue was due to an Alias of ‘curl’

To solve the issue run "Remove-Item alias:curl" from the same PowerShell window or write curl.exe instead of writing just 'curl'

Hope this will help you Winking smile

Sunday, June 26, 2016

Enable Hyper-v feature from PowerShell

As you may probably know Hyper-v comes with Windows 10 as Windows feature and if you would like to enable the same from PowerShell then its possible. You can also enable the feature from graphical way but here I am going to mention how its possible by using PowerShell.

1. Run PowerShell as administrator

2. Type “Get-WindowsOptionalFeature -Online |where featureName -Like "*hyper*" |ft” and hit enter. It will show the current status

image
3. Type “enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V-All -All –Verbose” and hit enter. Enter “Y” when prompted
image

4. Enter “Get-WindowsOptionalFeature -Online |where featureName -Like "*hyper*" |ft” gain to see the status, it should show all enabled
image

Enjoy the Hyper-v feature Smile

Thursday, July 30, 2015

Rest Admin account password of CUCM 7.1

Recently I came across a situation where i had to reset Admin password of CUCM as the CUCM team forgot the password, below are the steps
1. Console into CUCM server
2. Use username 'pwrecovery', password 'pwreset'.
clip_image002
3. Remove a disc into the CD/DVD driven and press any key
clip_image003
4. Insert a CD into the drive and press any key
clip_image005
5. Enter ‘a’ for resetting Admin account password
clip_image007
6. Enter a password for account "admin" and enter the password second time for confirmation.
clip_image009





Tuesday, July 28, 2015

Update SQL Express 2012 with service pack on Lync 2013 server

I have recently come across a situation where I had to upgrade Lync server to Skype for business 2015 and as part of preparing I had to update SQL 2012 express with service pack. Below are the steps for the same.

1. Before starting the update you have to make sure the service is down on the server.
Go to ‘Lync server Management Shell’ and run ‘Stop-Cswindowsservice’
clip_image002

2. Change the location to the install souce location and run caommand ‘.\SQLEXPR_x64_ENU.exe /ACTION=Patch /allinstances /IAcceptSQLServerLicenseTerms’
clip_image003

3. You can see extract is going on...
clip_image005

4. Check ‘I accept the licence terms.’ And click on next to continue.
clip_image007

5. Make sure that all instaces are selected and click on next
clip_image009

6. Click on next to continue
clip_image011

7. Make sure you can see all “success” and click on close
clip_image013

8. Start Lync services and make sure that everything works
clip_image015