Thursday, 15 February 2018

Remote Desktop Services deployment does not exist

When you are on the server and want to list active session using Get-RDUserSession command, you can see an error telling you that your have no RDS installed (even on RDS session broker), like the one below:

Don't be fooled by this - it shows only because you don't have enough privileges. Just run Powershell session as an administrator and bam! You can see desired list.

BTW: My small advice here - if you see PS errors, but you're sure, that cmd-let should work, check it with elevated privileges.

Tuesday, 8 August 2017

Windows 10: my screen went black

In Windows 10 there are color filters feature controlled with shortcut.
If you mistakenly hit that Ctrl+Win+C, you will apply color filter, which default settings is Greyscale. Hit it again to turn it off.
That's it!

Saturday, 1 July 2017

2003: Cannot start server after cloning it - activation error

After cloning 2003 server, because of hardware change you can see information that you have to activate Windows.
Your system probably has no drivers installed, so you will not be able to connect to the network and activate it again.
The solution is to do workaround for the time of installing drivers.
This omits activation and let you install whatever you need before turning it back off.
1.Open your regedit RUN > REGEDIT
2.Find key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WPAEvents
3.see the string OOBETimer
4.Double click.change all content with this one FF D5 71 D6 8B 6A 8D 6F D5 33 93 FD
5.Right Click on WPAEvents(Regedit)and choose Permissions
6.Window will show up,click to System and check all of Deny Listbox
7.Restart Your PC

To complete your device settings, it's good to get rid of old hardware that is hidden now and cause problems.
Run command:
set devmgr_show_nonpresent_devices=1

Add Legacy driver to 2003 OS

Friday, 30 June 2017

Windows10: If Google Chrome is loading webpages slowly

Right-click on the Chrome Icon, select "Properties".. 
Uncheck if set in compatibility mode for windows.

Also, try running the Compatibility Troubleshooter.

Powershell : How to export only errors from powershell command?

Sometimes, you need to export only the errors to your file, for example to show what needs to be corrected.

As you know, you can do an export from powershell cmd-let to a xml, csv or txt.
For example:
Get-Mailbox |Export-Csv .\mailboxes
Get-Mailbox |Export-Clixml
Get-Mailbox > mailboxes.txt

Additionally,  working in the loop, you can append data to the file, using -Append switch:
$users|%{Get-Mailbox $|Export-Csv .\mailboxes -Append}
But what to do in the situations when you need to export only errors in the current command?
For example you've created mailboxes according to the list, but then some of them were deleted.
One of the possibilities is to compare your list with errors from cmd-let.
You can do it manually, but it could be painful.
I propose you to use pipeline with using not well known switch >>.
This will output only errors to your txt file.
$users|%{get-mailbox $_.userprincipalname |select displayname, userprincipalname} 2>>MailboxNotExists.txt
Here are the switches you can use:
 > - Redirect pipeline output to a file,overwriting the current contents.
 >> - Redirect pipeline output to a file,appending to the existing content.
2>> - Redirect error output to a file,appending to the current contents.
2> - Redirect error output to a file,overwriting the current contents.
2>&1 - The error messages are written to the output pipe instead of theerror pipe.

Good reference here:

Tuesday, 17 January 2017

Powershell - how to get virtual machine GUID / ID (easiest way) from the hypervisor

Today, easy thing to manage, but of course - if you now how to do it.
To get VM ID from hypervisor, for example - to manage virtual machine from the powershell direct - you need to run simple command in the administrator session:

(get-vm virtualmachinename).id

Tuesday, 20 September 2016

Enforce BitLocker key backup saving to Active Directory

When BitLocker backup to AD has been turned on after configuring BitLocker on domain computers, then no keys are existing in the AD.
To enforce sending BitLocker key to AD, you need to:

1.Get ID and password from the needed computer:
manage-bde -protectors -get c:

2.Make a backup to AD for selected ID
manage-bde -protectors -adbackup c: -id {enter id of Numerical Password ID here}

If you see below error

this means that AD is not correctly set - computer has no permission to save backup to AD.