Modify Users sAMAccountName from Excel file

Const ADS_PROPERTY_UPDATE = 2

Ldapstr1 = "LDAP://w2k3-dc/dc=XXXX,dc=com"
Ldapstr2 = "LDAP://w2k3-dc.XXXX.com"

Set conn = CreateObject("ADODB.Connection")
conn.Provider = "ADSDSOObject"
conn.Open "ADS Provider"

const outputfile="c:\updateResult.txt"

Set wshShell = WScript.CreateObject ("WSCript.shell")
Set fso = CreateObject("Scripting.FileSystemObject")
Set f1 = fso.OpenTextFile (outputfile, 2, True)

On Error Resume Next
Set objExcel = CreateObject("Excel.Application")
If (Err.Number <> 0) Then
On Error GoTo 0
Wscript.Echo "Excel not installed."
Wscript.Quit
End If
On Error GoTo 0

strExcelPath = "c:\modify.xls"

objExcel.WorkBooks.Open strExcelPath
Set objSheet = objExcel.ActiveWorkbook.Worksheets(1)

' ilk satır başlık bilgisi,ikinci satırdan başlar.

intRow = 2
Do While objSheet.Cells(intRow, 1).Value <> ""

strCurrentSAM = objSheet.Cells(intRow, 1).Value
strNewSAM = objSheet.Cells(intRow, 2).Value


Set rs = conn.Execute( _
"<" & Ldapstr1 & ">;" _
& "(&(objectClass=User)(samAccountName="& strCurrentSAM &
"));Name,distinguishedName;subtree")

If (rs.recordcount = 1) then

strName = rs.Fields(0).Value
strdistinguishedName = rs.Fields(1).Value

Set objItem = GetObject(Ldapstr2 & "/" & strdistinguishedName)

objItem.put "samAccountName", strNewSAM

objItem.setinfo

set objItem = nothing
set rs = nothing

f1.Write strName & "," & strCurrentSAM & "," & strNewSAM & "," & "Done" &
VbCrLf

else

f1.Write strCurrentSAM & "," & "User not found" & VbCrLf

end if

intRow = intRow + 1
Loop

objExcel.ActiveWorkbook.Close
objExcel.Application.Quit


Set objExcel = Nothing
Set objSheet = Nothing

f1.close
conn.Close

Wscript.Echo "Done"

change Sql authentication method from Registry

you may need to change authentication method without installing SQL management studio for express editions
please follow these steps.
1.Stop SQL Server Service.
2.find HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\MSSQLServer




3.you can switch authentication method by changing "DWord value "LoginMode" and change the hex value to "2" from 1.
4.This will change the authentication mode to Mixed Mode from Windows.
5. Start SQL Server Service and login using SA or with a SQL login .
6.Sa account is disabled by default,so you need to enable and give password.
7. Enable SA account by logging in with WIndows Authentication --

from command prompy,
osql -E

ALTER LOGIN sa ENABLE ;
GO
ALTER LOGIN sa WITH PASSWORD = '' ;
GO

{for more info go to http://msdn.microsoft.com/en-us/library/ms188670.aspx}

== Login to SQL Server 2005 using "SA" account with the new password.

Microsoft Device Emulator save state problem

After you saved stated in your windows mobile device emulator,sometimes you cannot start from saved state and you see error:could not read saved-state file.to fix quickly,go to "%userprofile%\application data\microsoft\device emulator" and delete all files in it.

OCS Group Chat File Transfer Issue

when you install group chat server,file transfer feature is not working.
Group chat server has few services,channel service,lookup service and compliance service.
this problem is related to channel service.Channel service provides a connection between group chat,IIS and SQL db.When client sends a file to chat room,client queries the web site https://fqdn.domain.com/mgcwebservice/mgcwebservice.asmx and access to \\fqdn\gccshare location.I think this folder must be accessible from gcchannel user and everyone.
follow these steps for IIS 7

1.remember the gcchannel service account password :)
2.if they required ,change service account from "Group Chat Server Configuration tool".sometimes service cant be restarted.check the service logon credential.
3.go to IIS 7 console,in application pool,you will see "MGCWebService application pool".
4.right click to app pool and change the identity credential.



5.in default web site,go to MGCwebservice -IIS section-Authentication

6.7.right click anonymous auth and set "application pool identity"



7.now you can send file to chat room.

ps:check whether your server certificate is correct.you can use a test htm file and hit this link from client and see certificate is true or not.

how to move MSDTC resource to different cluster group

as best practice MSDTC resource can be located to different cluster group.
but it s tricky.

MSDTC -install command install MSDTC service
MSDTC -uninstall makes opposite.
msdtc -resetlog

to uninstall msdtc
msdtc -uninstall and then delete these registry keys

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\MSDTC

if exists HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSDTC.

--sometimes you see error 4394
--MS DTC's log information has not been configured correctly in the shared cluster ----registry.
--You have to check DCOMCNFG.exe and computer--properties MSDTC tab and log path.

after you uuninstall msdtc service.
reboot and msdtc -install
if you have clustered environment you will see msdtc resource in default cluster group.

to change MSDTC resource to different group ,follow these steps
ps:MSDTC resource group has dependency to disk and Network name.I assume you have another cluster group ,network name and disk resource in it.

1. Offline the MSDTC resource.
a. If moving the resource to a different group The MSDTC resource must be
deleted and recreated
2. Copy the DTC folder from the original drive to the destination drive (c:\windows\system32\msdtc)

3. Open the regedit on browse to "HKLM\Cluster\Resources\MSDTC Resource
GUID\GUID\DtcLogPath" change the value to the new path
4. Change dependency to the New Disk (in different group)
5. From a Cmd line "MSDTC -resetlog"
6. Bring MSDTC resource online

when upgrading OCS R1 to OCS R2

Upgrade list for OCS R1 --> OCS R2

1.download OCS 2007 Global Settings Migration Tool

2.setup MigrateOCS.msi.
3.cscript MigrateOcsGlobalSettings.vbs /Action:MigrateGlobalSettingsTree command.This command will copy the RTC service container to Configuration partition.
4.cscript MigrateOcsGlobalSettings.vbs /Action:MigrateGlobalSettingsProperties
Copy the attributes by using this command.



5.You need to give required permission to new container.
lcscmd /forest /action:ForestPrep /global:configuration
lcscmd/domain /action:DomainPrep

now,wait for replication.This is very important.If you cant replicate the changes to other global catalog servers.You will get "contraint violation" error in next step.
this sets up the permission on new objects.

6.cscript MigrateOcsGlobalSettings.vbs /Action: MigrateServerDnReferences
you are saying to servers ,this is my new configuration container.

/SearchBaseDN: is optional parameter.

7.cscript MigrateOcsGlobalSettings.vbs /Action: MigrateUserDnReferences /SearchBaseDN:
you are doing samething to user objects.

8.try to start all ocs services.Then test IM,conference,call features.
If all tests are successfull ,you can run this command:
cscript MigrateOcsGlobalSettings.vbs /Action: DeleteSystemGlobalSettingsTree

Firewall port design for OCS EDGE SERVER




check the planning tool,
http://www.microsoft.com/downloads/details.aspx?familyid=FDF32585-C131-4832-8E27-67E70636C1E8&displaylang=en

How to customize QUOTA messages in Exchange 2007

How to customize QUOTA messages in Exchange 2007

Set-SystemMessage -Identity EN\WarningMailbox -Text "Modified Message"

Set-SystemMessage En\WarningMailbox -Text "Please archive your mailbox."

New-SystemMessage -QuotaMessageType ProhibitSendMailbox -Language EN -Text "you can't send mail.sorry."

SCVMM and ESX integration issue.
as you know,SCVMM 2008 can work together esx server.You can add esx host server to scvmm management konsole and easily manage.top issues about scvmm and esx integration
limited connectivity and security.

When you add esx host to console ,you see OK(limited).this means you cannot perform basic operations like "save state".
to enable Full management over ESX,
go to ESX host-properties security in scvmm console.
you will see credentials for this host and certificate.
enter esx credentials username,password.
Click retrieve and click "accept both the certificate and public key for this host".

now, you can perform lots of operations but you cannot transfer iso and vm template file to esx.
on esx server login on console and
go to /etc/ssh path.
vi sshd_config
click i for insert
find "PermitLoginforRoot no" and change it to "yes".
to exit use ZZ or :wq command.
restart sshd service by using "/etc/init.d/sshd restart"

now enjoy full integrated esx and SCVMM console.

WMI scripts-stop service

Set objSpoolerSvc =GetObject("WinMgmts:Win32_Service.name='Spooler'")
Set objOutParm = objSpoolerSvc.ExecMethod_("stopService")
If objOutParm.returnValue = 0 Then
WScript.Echo " The Spooler Service has been stopped"
Else
wscript.Echo "Error: " & objOutParm.returnValue
End If