June 18, 2014

SCVMM 2012 - SMI-S Dell Storages

SMI-S for Dell MD PowerVault Storages (Compatible with System Center Virtual Machine Manager 2012)

Link: http://opensource.dell.com/releases/PowerVault_MD/SMI-S/

Hyper-V Volume Shadow Copy Requestor service failed

System Error 7000:
The Hyper-V Volume Shadow Copy Requestor service failed to start due to the following error:
The executable program that this service is configured to run in does not implement the service.













 


Fix:
Add to "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Svchost\LocalSystemNetworkRestricted" "vmicvss" entry.

May 27, 2014

Exchange - Distribution lists report

There is one drawback using Get-DistributionGroupMember script. Actually when you run it in a pipe for multiple distribution groups you can't determine in what group member is.

I would like to present wonderful PowerShell script that generates good report. This report have following fields: Distribution Group Name, SamAccountName and primary smtp address of distribution list, Name of user, Samaccountname, recipient type, primary smtp address of member.

I found it very useful in exchange infrastructure migration/consolidation processes. 

Here is syntax:

$R=@()
$G=Get-DistributionGroup
$G| foreach{
$GN=$_.Name
$GSAN=$_.Samaccountname
$GADDR=$_.primarysmtpaddress
$RT=Get-distributionGroupMember -identity $_.identity | select @{Name='Distribution Group'; Expression={[String]::join(";", $GN)}}, @{Name="DL SAN"; Expression={[String]::join(";", $GSAN)}},@{Name="DL PrimarySmtpAddress"; Expression={[String]::join(";", $GADDR)}}, Name, samaccountname,RecipientType,PrimarySmtpAddress
$R=$R+$RT
}
$R| export-csv DL-Report.csv

Office 365 - Shared mailboxes auto-mapping

Exchange On-premises to Office 365 post migration auto-mapping issue:

Here is msExchDelegateListLink attribute that is being populated when you grant full access to mailbox.This attribute is responsible for auto-mapping shared mailboxes in users outlook.
If you migrate mailbox to Office 365 this attribute is migrated as well according to http://social.technet.microsoft.com/wiki/contents/articles/19901.list-of-attributes-that-are-synced-by-the-windows-azure-active-directory-sync-tool.aspx

In Office 365 (if we connect remotely using http://technet.microsoft.com/en-us/library/jj984289%28v=exchg.150%29.aspx) we couldn't manage msExchDelegateListLink attribute due to Office 365 limitations.

As result we can't disable or manage auto-mapping for mailbox changes that took place before migration.

When we run "Get-MailboxPermission SharedMailbox1@example.com" we do not see any permission entires for user1@example.com but shared mailbox is still showing up in users outlook.

If we need to remove auto-mapping (as result remove Full Access permission) for user1@example.com from SharedMailbox1@example.com we have to grant permission first and then remove it.

Add-MailboxPermission SharedMailbox1@example.com -User user1@example.com -AccessRights FullAccess -InheritanceType All
Remove-MailboxPermission SharedMailbox1@example.com -User user1@example.com -AccessRights FullAccess -InheritanceType All


Also it worth to check mailbox folder permissions in case if you provided permissions for mailbox internally:

Get-MailboxFolderPermission SharedMailbox1@example.com
Remove-MailboxPermission SharedMailbox1@example.com -User user1@example.com -AccessRights FullAccess -InheritanceType All

April 24, 2014

Exchange 2010 - distribution lists clean up

Run in Exchange Management Shell:

$DL= get-distributiongroup -resultsize unlimited
$DL |? {!(get-distributiongroupmember $_)} | select Name,DisplayName,Alias,PrimarySmtpAddress,DistinguishedName | export-csv EmptyGroups.csv

Import module for Active Directory:
Import-Module ActiveDirectory

Move AD groups to dedicated OU (for organizational perspective):
Import-Csv EmptyGroups.csv | foreach {move-ADObject -Identity $_.DistinguishedName -TargetPath "OU=ExampleOU,DC=example,DC=local"}

Distribution groups could be disabled in 2 ways:
1. Navigate to Recipient Configuration - Distibution Group and sort groups by Organizational Unit, select multiple groups and click disable.
2. Run following PowerShell script: Import-Csv EmptyGroups.csv | foreach {Disable-DistributionGroup -Identity $_.Alias}

March 31, 2014

Outlook 2010 - inbox rules

How to get list of Inbox rules using PowerShell on local workstation?

#Requires -version 2.0
Add-Type -AssemblyName microsoft.office.interop.outlook
$olFolders = "Microsoft.Office.Interop.Outlook.OlDefaultFolders" -as [type]
$outlook = New-Object -ComObject outlook.application
$namespace  = $Outlook.GetNameSpace("mapi")
$folder = $namespace.getDefaultFolder($olFolders::olFolderInbox)
$rules = $outlook.session.DefaultStore.GetRules()
$rules |
Sort-Object -Property ExecutionOrder |
Format-Table -Property Name, ExecutionOrder, Enabled, isLocalRule -AutoSize


Source: http://blogs.technet.com/b/heyscriptingguy/archive/2009/12/15/hey-scripting-guy-december-15-2009.aspx

February 14, 2014

RDS - Licensing issue

Windows Logs - System - Event ID 4105 (Warning):
The Remote Desktop license server cannot update the license attributes for user "UserName" in the Active Directory Domain "yourdomain". Ensure that the computer account for the license server is a member of Terminal Server License Servers group in Active Directory domain "yourdomain".
If the license server is installed on a domain controller, the Network Service account also needs to be a member of the Terminal Server License Servers group.
If the license server is installed on a domain controller, after you have added the appropriate accounts to the Terminal Server License Servers group, you must restart the Remote Desktop Licensing service to track or report the usage of RDS Per User CALs.


Resolution:
Open ADUC
Find user "UserName"
Click Properties
Go to Security tab
Click Add and type Terminal Server License Servers, click OK
Allow "Read Terminal Server license server" and "Write Terminal Server license server" permissions.
Click OK.

After next logon to terminal server you will see Information message id 4143 under Microsoft-Windows-TerminalServices-Licensing/Admin log.

February 12, 2014

PowerShell - Active Directory query

How to query AD using list of users in format - "Surname, First Name"?

test.csv file format:
Identity
"Surname1, FirstName 1"
"Surname2, FirstName 2"
"Surname3, FirstName 3"
"Surname4, FirstName 4"
"Surname5, FirstName 5"

PowerShell script:
Import-Csv test.csv | foreach { $U = $_.Identity; Get-AdUser -filter { DisplayName -eq $U }}

February 6, 2014

SCOM - Hyper-V warnings

The Windows Event Log Provider is still unable to open the Microsoft-Windows-Hyper-V-Network-Admin event log on computer ‘ServerName.DomainName’.
The Provider has been unable to open the Microsoft-Windows-Hyper-V-Network-Admin event log for 720 seconds.

Resolution:

December 27, 2013

NTFS - Allocation unit size

How to determine allocation using size for NTFS volume? 

 

C:\Windows\system32>fsutil fsinfo ntfsinfo G:
NTFS Volume Serial Number :       0xa490234b90232372
Version :                         3.1
Number Sectors :                  0x00000000013fe7ff
Total Clusters :                  0x00000000009ff3ff
Free Clusters  :                  0x00000000009ec35f
Total Reserved :                  0x0000000000000000
Bytes Per Sector  :               512
Bytes Per Physical Sector :       <Not Supported>
Bytes Per Cluster :               1024
Bytes Per FileRecord Segment    : 1024
Clusters Per FileRecord Segment : 1
Mft Valid Data Length :           0x0000000000040000
Mft Start Lcn  :                  0x0000000000300000
Mft2 Start Lcn :                  0x0000000000000008
Mft Zone Start :                  0x0000000000300000
Mft Zone End   :                  0x0000000000332020
RM Identifier:        50799E58-5C23-11E3-B7B1-080027008833

December 25, 2013

Exchange - some useful utils

http://oabvalidate.codeplex.com/ - OAB validate your off-line address book.
http://mfcmapi.codeplex.com/ - MFCMAPI uses Microsoft's published APIs to provide access to MAPI stores through a graphical user interface. Its purpose is to facilitate investigation of Exchange and Outlook issues and to provide developers with a canonical sample for MAPI development.

November 21, 2013

Hyper-V - Management

# List of network interfaces on hyper-v host (need name for next command):
Get-NetAdapter

# Create new virtual switch:
New-VMSwitch -AllowManagementOS $False -Name "VirtualSwitchName" -NetAdapterName "Name of network interface"

# Creating network interface that will be acting as management:
Add-VMNetworkAdapter -ManagementOS -Name "InterfaceName" -SwitchName "VirtualSwitchName"

# Setting management vlan on newly created interface:
Set-VMNetworkAdapterVlan -ManagementOS -VMNetworkAdapterName "InterfaceName" -Access -VlanId <VLAN NUMBER>

November 13, 2013

Windows Server 2012 - Installing .NET Framework 3.5

How to install .NET Framework 3.5 (including .NET 2.0 and 3.0) on Windows Server 2012?
  • Insert Windows Server 2012 DVD or iso to D drive
  • Open Add Roles and Features Wizard
  • Select .NET Framework 3.5 Features and then click next
  • Select Specify an alternate source path link in the Confirm installation selections screen
  • Path: D:\Sources\SxS and then click OK
  • Then click Install button

October 30, 2013

PowerShell - User membership

How to remove particular user (mailbox) from all associated groups (distribution lists)?

import-module ActiveDirectory
$USERNAME = read-host "Enter Username (samaccountname):"
$USERS = (Get-ADUser $USERNAME -properties memberof).memberof
$USERS | Remove-ADGroupMember -Members $USERNAME -Confirm:$false

October 29, 2013

SQL - Report

How to get current information about all sql databases, sizes and owners on SQL server?

sp_helpdb (Transact-SQL)
Reports information about a specified database or all databases.

Source: http://technet.microsoft.com/en-us/library/ms178568.aspx

October 24, 2013

Active Directory - Creating custom ADM file

Creating custom ADM file to control JAVA update in Active Directory via Group Policy.
___________________________________________________
___________________________________________________
CLASS MACHINE

CATEGORY !!JavaUpdate

POLICY !!Checkforupdatesatstart
KEYNAME "SOFTWARE\JavaSoft\Java Update\Policy"
EXPLAIN !!CheckforupdatesatstartHelp
VALUENAME "EnableAutoUpdateCheck"
VALUEON NUMERIC 1
VALUEOFF NUMERIC 0
END POLICY

POLICY !!EnableJavaUpdater
KEYNAME "SOFTWARE\JavaSoft\Java Update\Policy"
EXPLAIN !!EnableJavaUpdaterHelp
VALUENAME "EnableJavaUpdate"
VALUEON NUMERIC 1
VALUEOFF NUMERIC 0
END POLICY

POLICY !!CheckforupdatesatstartX64
KEYNAME "SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy"
EXPLAIN !!CheckforupdatesatstartHelp
VALUENAME "EnableAutoUpdateCheck"
VALUEON NUMERIC 1
VALUEOFF NUMERIC 0
END POLICY

POLICY !!EnableJavaUpdaterX64
KEYNAME "SOFTWARE\Wow6432Node\JavaSoft\Java Update\Policy"
EXPLAIN !!EnableJavaUpdaterHelp
VALUENAME "EnableJavaUpdate"
VALUEON NUMERIC 1
VALUEOFF NUMERIC 0
END POLICY

END CATEGORY

[strings]
JavaUpdate="Java Update"
EnableJavaUpdater="Enable Java Updater"
EnableJavaUpdaterHelp="When set to Enabled, Java Updater can run and the 'Check for updates' option appears on the Help menu. When set to Disabled, Java Updater cannot run and the 'Check for updates' option does not appear on the Help menu."
Checkforupdatesatstart="Check for updates at start"
CheckforupdatesatstartHelp=""When set to Enabled Java will check for updates at startup.  When set to Disabled Java will not check for updates at startup."
EnableJavaUpdaterX64="Enable Java Updater for X64 systems"
CheckforupdatesatstartX64="Check for updates at start for X64 systems"

___________________________________________________
___________________________________________________

October 18, 2013

QwikMark - CPU benchmark

QwikMark provides fast and easy benchmarking. Many excellent benchmark tools already exist, but QwikMark is unique because it tests everything on a single screen. It was used to test Hardware commands for vTask Studio.

As with all benchmarking utilities, hardware performance measurements are an inexact science, however QwikMark closely matches results from industry standards like CPU-Z, SiSoftware Sandra, and Atto. The download is just a single file, no supporting files are required.

October 15, 2013

Active Directory - Service Accounts

Looking for Service Accounts in your Active Directory?

Get-WmiObject Win32_Service -comp (Get-ADComputer -filter * -SearchScope Subtree -searchbase 'OU=ServersOU,DC=domain,DC=com'| where {$_.enabled -like "True"} | select -expand name) | where-object { ($_.startname -ne "LocalSystem") -and ($_.startname -ne "NT AUTHORITY\LocalService") -and ($_.startname -ne "NT AUTHORITY\NetworkService") -and ($_.startname -ne "NT AUTHORITY\LOCAL SERVICE") -and ($_.startname -ne "NT AUTHORITY\NETWORK SERVICE") -and ($_.startname -ne "NT AUTHORITY\SYSTEM")} | select SystemName,name,startname,startmode,State,status | export-csv C:\Folder\ServiceAccounts.csv

October 3, 2013

Microsoft Windows - Determine last logon time

How to determine inactive users on Terminal Server based on last logon time information?

Run NetUsers.exe util with /history key.

C:\Users\vfedenko\Desktop>NetUsers.exe /history
-------------------------------------------------------------------------------
History of users logged on locally at SERVERNAME:            Last Logon:
-------------------------------------------------------------------------------
-------------------------------------------------------------------------------
The command completed successfully.


Donwnload NetUsers - http://www.systemtools.com/cgi-bin/download.pl?NetUsers

September 4, 2013

Exchange 2010 - Scheduled mailbox auto-reply

How to setup auto-reply for mailbox during time period? e.g. everyday started from 6 P.M. to 9 A.M. 

On client (server) with exchange management tools installed create two windows basic tasks:

First one "Auto-reply enabled" (name is up to you) with following script syntax which occurs every day at 6 P.M.:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\V14\Bin\ExShell.psc1" -Command ". Set-MailboxAutoReplyConfiguration -identity NAME_OF_MAILBOX -AutoReplyState Enabled"

Second one "Auto-reply disabled" which occurs every day at 9 A.M:
C:\Windows\System32\WindowsPowerShell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\Exchange Server\V14\Bin\ExShell.psc1" -Command ". Set-MailboxAutoReplyConfiguration -identity NAME_OF_MAILBOX -AutoReplyState Disabled"

August 27, 2013

August 21, 2013

AutoIt - Automation and Scripting Language

AutoIt v3 is a freeware BASIC-like scripting language designed for automating the Windows GUI and general scripting. It uses a combination of simulated keystrokes, mouse movement and window/control manipulation in order to automate tasks in a way not possible or reliable with other languages (e.g. VBScript and SendKeys). AutoIt is also very small, self-contained and will run on all versions of Windows out-of-the-box with no annoying “runtimes” required!

Source: http://www.autoitscript.com/site/autoit/

July 1, 2013

PlayOnLinux

PlayOnLinux is a piece of software which allows you to easily install and use numerous games and apps designed to run with Microsoft® Windows®.
Few games are compatible with GNU/Linux at the moment and it certainly is a factor preventing the migration to this system. PlayOnLinux brings a cost-free, accessible and efficient solution to this problem.

Source: http://www.playonlinux.com/en/

June 30, 2013

Quest Free Network Tools

Quest Free Network Tools (QFNT) includes 16 individual feature sets providing dozens of network troubleshooting capabilities. With a straightforward user interface, customizable dashboard, and robust tools that increase your productivity, this FREE product suite delivers additional efficiency and effectiveness to front line IT personnel.
The Quest Free Network Tools suite consolidates several useful network monitoring and troubleshooting tools into a single, integrated interface offering:
  •     Network and device discovery
  •     Device monitoring via SNMP, WMI, Syslog and NetFlow
  •     Exchange, SQL and Active Directory monitoring
  •     Cisco configuration file backup and upload
  •     Seamless workflow between tools and dashboards
  •     Performance and inventory reports
All of these tools complement the extensive real-time monitoring provided by Foglight Network Monitoring System (NMS) and can be run directly from within the Foglight NMS Studio.