Friday, 28 February 2014

Export csv files separated by semicolons

When you try to export files from Excel after manage them, you could see that even if you choose .csv format data has been divided by semicolons instead of commas.
This could be caused by regional settings.
Change the list sepearator in Formats-Additional settings within Region(Windows8) or Regional(Windows7) settings from semicolon(;) to comma(,) and decimal symbol from comma(,) to dot(.).
If you need to have decimal symbol as comma, then Excel will still export .csv files with semicolons.
I've found small script which does resolve problem in this case
You can create new macro in Excel, put this script inside, and run macro when your file is ready to be saved.
I will post the script soon

Wednesday, 19 February 2014

How to add user to local administrators from command line remotely

Sometimes, you need to add user to local administrators from command line, especially if you're doing this remotely.
It's an easy process when you are using old, dusty net command.

Check adminstrators group members :
net localgroup administrators

To add\john to local administrators::
net localgroup administrators /domain john /add

Sunday, 16 February 2014

Editing and testing gpo policies from different domain

Sometimes there is a need to test or edit policy on different server. 
Maybe it's because machine has more tools installed or is outside the production network.
It'll be good if both machines run the same OS versions.
Steps to copy settings from one gpo to other:
1.Make empty gpo policy on both servers in Group Policy Management console
2.Edit policy settings and test it on the server/organization you're prefer.
3.Go to Group Policy Objects and select your policy
4.Click Backup

5.Go through backup wizard and save policy to the desktop

6. Copy this folder to your test/editing machine
7. Go to Group Policy Objects in gpmc
8. Select your policy and click Import Settings:

9. Again, go through Import Settings Wizard, select your policy and...
10. That's It!

Saturday, 15 February 2014

I've lost Internet Explorer Maintenance add-in in from Group Policy Management Console!

Guys, I can't see Internet Explorer Maintenance add-in in Group Policy Management Console!
It was there and now it's gone. See, I have this policy configured and it works. So, what happened?
I am omitting here the necessity to import Internet Explorer .adm file to be able to manage it because it's another topic to describe.
This is example of what you can see: policy with IE maintenance set and no option to change settings:

Well, it's something that you probably didn't expected to be connected with - Internet Explorer version.
You've probably have had configured automatic updates on your server, haven't you?
Well, if your server have had installed Internet Explorer 10 or 11, then you've lost possibility to configure Internet Explorer earlier versions (till 9) from GPO mmc.

There are two ways to reclaim your rights to manage IE settings through gpo:
1.Uninstall IE till the 9 version through Programs and Features in updates section (BTW - I'm using quick way to access it: from Run prompt and enter appwiz.cpl)

2.If you can't uninstall newer versions of IE by any reason, you could use other server where you can see Internet Explorer Maintenance add-in, even if it's in different domain.

I've described how to do this here:

Friday, 14 February 2014

Enabling remote desktop remotely from cmd: netsh

Just simple but useful command to enable remote desktop access.
Advfirewall netsh context works on systems newer than XP.

netsh advfirewall firewall set rule group="remote desktop" new enable=Yes

Copy users from one AD group to another

Are you tried to switch the AD groups?
If yes you probably encounter a problem with how to copy all users from one group to another.
I found easy vbs script for doing this on the Technet here .
Please remember that this is not my work, but I'm using it and checked that it's working correctly.
First, you need to enter object source in the format of CN, OU, DC,DC, for example CN=group, OU=Atlanta, OU=Company, DC=contoso, DC=com.
Then you'll need to do the same with the destination group.
Here is the script:

strSGroupDN = InputBox ("Enter the DN of Source Group" & VBCRLF &_
                  vbcrlf& _
                  vbcrlf& _
                  "e.g. CN=Source Group,OU=Users,DC=NWTraders,DC=com")
strDGroupDN = InputBox ("Enter the DN of Destination Group" & VBCRLF &_
                  vbcrlf& _
                  vbcrlf& _
                  "e.g. CN=Destination Group,OU=Users,DC=NWTraders,DC=com")

set dicSeenGroupMember = CreateObject("Scripting.Dictionary")
set objDGroup = GetObject("LDAP://" & strDGroupDN)

DisplayMembers "LDAP://" & strSGroupDN, dicSeenGroupMember
Function DisplayMembers (strGroupADsPath, dicSeenGroupMember)
   set objGroup = GetObject(strGroupADsPath)
   for each objMember In objGroup.Members
       objDGroup.Add("LDAP://" & objMember.distinguishedName)
End Function

MsgBox "Group Members have been copied to Destination Group"

Monday, 10 February 2014

Manually configure Outlook profile for Office 365

If you have problems configuring Outlook profile with autodiscover, then reading this should help you. If you need to resolve this, check this post:

Steps for configure Outlook Office 365 profile manually:

1. Logon to Office365 from powershell as described here:

2. Get your mailbox cloud ExchangeGuid:

Get-Mailbox mailboxname |fl ExchangeGuid, OriginatingServer, PrimarySmtpAddress,UserPrincipalName

3. Copy this data to your computer with Outlook.

4. Go to your computer with Outlook.
5. Open Mail in Control Panel options. Click Add New Account.
6. Choose Manually configure server settings or additional server types

7. Choose Microsoft Exchange or compatible service:

8. Click More Settings:

9. In the connection tab, select Connect to Microsoft Exchange using HTTP:


10. Click Exchange Proxy Settings...

11. Fill in the tabs:


Click OK.

12. Go to the Security tab and select "Anonymous Authentication" in Logon network security:

Click OK.
13. In the Add New Account window fill fields with data that you've gathered from Office365

14. In the Server: you can use ExchangeGuid which is mailbox guid with the format:
ExchangeGuid@domain, for example

you can use Originating Server Name which will look for user name you provided, for example:

15. In the User Name, enter user PrimarySMTPAddress

Click Check Name

You should then get credential pop-up which is good sign:

16. In the user name field use the UserUPNAddress - probably the short alias.
17. Enter the password and...

Voila! You are in.

Well, you should, but... If you still have problems configuring this, then consider following, mostly if you had this profile earlier, for example after migration from on-premises to the cloud:

1.       Delete all Outlook credentials from Windows Credential Manager

2.       Go to the Control Panel/Mail

3.       Delete current profile

4.       Create new profile

Sunday, 2 February 2014

Outlook: Resolving credential pop-up issue after moving to Office365. Step by step.


After moving some mailboxes to the cloud, you can enter dark zone.
Some, most or even all of the users could start complain, that this nagging credential pop-up starts showing up after every Outlooks windows open.

In most cases it is enough to click Cancel to start using Outlook, in others - you have to provide password.

Below you can see solution for company that I manage. It could resolve your problem or let you know where to search problems.

After any step please restart Outlook and check its behavior within 5-10 minutes.

1. For testing purposes - remove any access for other mailboxes which users has access to from Exchange and Outlook side.

Exchange side 
(you can change AccessRights, but probably this is what you want):
First run this cmd-let to check permissions:

Get-Mailbox -Server ServerName | Get-MailboxPermission -user mailbox.alias | where { ($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITY\SELF”) }

If the list is long and you don't want do remove all entries, you can pipe them out:

Get-Mailbox -Server ServerName | Get-MailboxPermission -user mailbox.alias | where { ($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITY\SELF”) }|fl >C:\temp\fullaccess.txt

If you want to remove all access that list shows, then go on: 

Get-Mailbox -Server ServerName | Get-MailboxPermission -user mailbox.alias | where { ($_.AccessRights -eq "FullAccess") -and ($_.IsInherited -eq $false) -and -not ($_.User -like “NT AUTHORITY\SELF”) } |Remove-MailboxPermission

Outlook side:
Go to advanced account settings and look if it has another mailboxes added. If yes-write down each name and remove them all for testing.

In the same window clear “Download shared folders”

2. Disable or remove shared calendars in Outlook

3. Check DNS suffixes on any used connection (Wi-Fi, LAN) advanced TCP/IP protocol version properties. 
In the “Append these DNS suffixes (in order)” you can find some entries which are OK, but if they are not set for your company or you know they are not correct – remove them.

4. Check Outlook Anywhere settings:
For migrated users - check if the user has been added to migrated users security group if you set one for gpo for OutlookAnywhere settings as we did. If not - add him or her and re-logon to the Windows
For non-migrated to Office365 users OA should be disabled or set as you probably know how- if not you can check on different Outlook, which is working properly,  
For users migrated to Office365 OutlookAnywhere should be set as follows: 

5. Delete .ost outlook files in user profile (%userprofile%\AppData\Local\Microsoft\Outlook
6. Delete cached credentials in Windows Credential Manager
7. Disable all COM add-ins in Outlook options:

8. Disable Microsoft Lync if user is using it
9. Run Outlook in Safe mode (run with Ctrl key pressed)
10. Recreate Outlook profile in the Mail option in the Control Panel
11. Run Outlook with /rpcdiag switch to check exactly how Outlook is trying to connect,make a screenshot for future use - maybe Microsoft support?
12. When Outlook is opened rightclick on Outlook icon in the tray and select "test connection" option, and check to which servers Outlook is trying ro connect,make a print screen too.
13. Create the same user account on clean Windows installation.If Outlook will work properly, recreate Windows user profile on problematic computer.