Cleanup winsxs folder

Do not delete files manually from winsxs folder . Instead use the following command to remove old servicepack files.

dism.exe /online /cleanup-Image /spsuperseded
Posted in Fix IT, Tips | Comments Off on Cleanup winsxs folder

Check NTP on windows computer

Start a command  shell and use the following command.  Here ch.pool.ntp.org is an array of ntp servers delivered by dns query.

w32tm /stripchart /computer:ch.pool.ntp.org /dataonly /samples:5

You should get a response like  this. In this sample the first few request are delayed. This is not so good.

w32tm.jpg

Posted in Fix IT, Information Technology | Tagged | Comments Off on Check NTP on windows computer

SCOM, find stucked agents

Some times agents start to stop collecting data without stopping completely . this is often when client are overloaded or management servers are for a while unavailable. In my case most times disk space counters stopped working as on of the first roles. So check this counter frequently, like every week or after maintenance jobs.

It can be easy done by using a query towards ops db.

First create a view

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
CREATE VIEW [dbo].[50beansDiskFreeSpace]
AS
SELECT TOP (10) PERCENT bme.Path, ps.PerfmonInstanceName, pdav.SampleValue, pdav.TimeSampled, dbo.MaintenanceMode.IsInMaintenanceMode
FROM dbo.PerformanceDataAllView AS pdav WITH (NOLOCK) INNER JOIN
dbo.PerformanceSource AS ps WITH (NOLOCK) ON pdav.PerformanceSourceInternalId = ps.PerformanceSourceInternalId INNER JOIN
dbo.Rules AS r WITH (NOLOCK) ON ps.RuleId = r.RuleId INNER JOIN
dbo.BaseManagedEntity AS bme WITH (NOLOCK) ON ps.BaseManagedEntityId = bme.BaseManagedEntityId INNER JOIN
dbo.MaintenanceMode ON bme.BaseManagedEntityId = dbo.MaintenanceMode.BaseManagedEntityId
WHERE        (r.RuleName LIKE N'%LogicalDisk.FreeMB%' OR
r.RuleName = N'Microsoft.Windows.Server.ClusterDisksMonitoring.ClusterDisk.Monitoring.CollectPerfDataSource.FreeSpaceMB') AND (pdav.TimeSampled =
(SELECT MAX(TimeSampled) AS Expr1
FROM dbo.PerformanceDataAllView
WHERE        (PerformanceSourceInternalId = pdav.PerformanceSourceInternalId)))
ORDER BY pdav.TimeSampled
GO

Now run the view . On top you will find all disks in Maintenance mode. It is clear they did not collect any data within the last few minutes . After that follow all servers with a partly disabled agent. on the bottom you will find clients having an TimeSampled within an few minutes. They are working well.

sql

Posted in Fix IT, Information Technology | Tagged | Comments Off on SCOM, find stucked agents

Powershell from scheduled task

As powershell is running by default in secure mode , use the following setting to run powershell scripts from a scheduled task.

This way you do not have to elevate the rights for running scripts. Ensure your Powershell script is located in a folder where he is well protected from tempering bud accessible by the user the scheduled task is running under.

 

executable: Powershell.exe

Option: -ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden –File <Path and Scriptname>

Example for Option :-ExecutionPolicy Bypass -NoLogo -NonInteractive -NoProfile -WindowStyle Hidden –File C:\scripts\myscript.ps1

Posted in Information Technology, Tips | Tagged | Comments Off on Powershell from scheduled task

WordPress 4.1 and XML-RPC for Microsoft Word

 

Problem

I used to write posts using Microsoft Word. After updating to WordPress 4.1 blogging was not possible anymore . In WordPress the settings for XML-RPC disappeared.

Solution

Microsoft is offering a free bundle of software called : Windows Essentials

http://windows.microsoft.com/de-ch/windows-live/essentials-other#essentials=overviewother

Install only Windows Live Writer from this bundle. It is better than Word for blogging as you can apply categories etc.

Info: to change the path where Live Writer saves your local documents add the following RegKey

Windows Registry Editor Version 5.00

[HKEY_CURRENT_USER\Software\Microsoft\Windows Live\Writer]
“PostsDirectory”=”A:\\Cloud-Mix\\Posts”

Posted in Fix IT | Tagged | Comments Off on WordPress 4.1 and XML-RPC for Microsoft Word

ADDS Dump thumbnailPhoto to JPG file

Use this command line in Powershell to save a users thumbnailPhoto to a file.
First start a Powershell session with Active Directory Modules loaded, then:

get-aduser “sAMAccountname” -server “FQDN Domain Controller”-properties thumbnailPhoto | select -expandproperty thumbnailphoto | set-content -path “JPG Location” -encoding byte

Example:
get-aduser peter_miller -server dc1.contoso.com -properties thumbnailPhoto | select -expandproperty thumbnailphoto | set-content -path c:\temp\peter_miller.jpg -encoding byte

The option -server is optional. Use it to prove that all servers return the same picture (check sync problems)

Posted in Information Technology, Tips | Tagged , | Comments Off on ADDS Dump thumbnailPhoto to JPG file

Clear Protected from accidental deletion flag

Windows Active Directory protects per default Organizational Units (OU) from accidential deletion .

To clear this flag for an entire OU structure you can use this Powershell commands . This example command will remove the flag from an OU structure  OU=acme,DC=scom,DC=local and all child OUs .

1
2
3
sl AD:
sl "dc=scom,dc=local"
get-childitem -recurse OU=acme | where {$_.ObjectClass -match "organizationalUnit"} | Set-ADOrganizationalUnit -ProtectedFromAccidentalDeletion $false

 

Posted in Information Technology, Tips | Tagged , | Comments Off on Clear Protected from accidental deletion flag