Tuesday, December 21, 2010
Tuesday, November 9, 2010
Appsense and Citrix
Friday, November 5, 2010
VBscript for getting Computer Model using WMI system class
Saturday, October 16, 2010
Windows error when logging on - a problem is preventing windows from accurately checking the license for this computer. error code
They should be in the %system root% \ system32 folder
just type the following statements one by one, hit ENTER after each, of course:
regsvr32 licwmi.dll
regsvr32 regwizc.dll
regsvr32 licdll.dll
Thursday, October 14, 2010
Friday, October 8, 2010
DHCP not updating DNS records, 31,DNS Update Failed -1
You need to kill tcpsvcs.exe from task manager to restart it properly and it will starting working temporarily till it starts using high mem again(develops the leak again)
MS recommended hotfix
http://support.microsoft.com/kb/939928
Ofcourse you got check your DHCP and DNS config are correct for DDNS
------IGNORE EVERYTHING BELOW--------
For some reason after replacing an Old DC / DHCP server, the DNS updates keep failing
Tuesday, September 14, 2010
Creating Custom ADM Templates
Monday, July 12, 2010
Export Mailbox to PST, Exchange 2007
C:\WINDOWS\system32\windowspowershell\v1.0\powershell.exe -PSConsoleFile "C:\Program Files\Microsoft\bin\exshell.psc1" -command C:\Scripts\user.ps1
pause
$PSTPath = read-host "Enter the pst pathname E:\Temp\"
get-mailbox -identity $id | Export-Mailbox -PSTFolderPath $PSTPath
Write-host -fore Yellow "Check the STATUS MESSAGE to see if successfull or any errors have occured. Then PRESS ANY KEY to Continue"
Thursday, July 8, 2010
Wednesday, May 12, 2010
I can ping other PC's but other PCs can ping me??
Thursday, April 29, 2010
"DHCP...." followed by "PXE-E53: No boot filename received"
SYMPTOM
When being started, the PXE client comes up with the PXE copyright message, then displays
DHCP....
After a while, the following error message is displayed:
PXE-E53: No boot filename received
Depending on the PXE client's system setup boot device list configuration, the PC then either stops or tries to boot from the next boot device in the system setup boot device list.
CAUSE
The "PXE-E53" error indicates that the PXE client received a reply to its DHCPDISCOVER message, but the "boot filename" information was missing in this reply.
RESOLUTION
Make sure that the "boot filename" option is present on your DHCP or BOOTP server, and that its value is set to the filename of the boot loader.
When using Microsoft DHCP server, add option 067 (Bootfile Name) to your scope. When using a Unix/Linux based (ISC) DHCP server, use the "filename" parameter for this purpose.
In the context of the BootManage Administrator, the boot loader filename is "pxboot" for PXE clients and "bpboot" for TCP/IP BOOT-PROM clients. So, if you have exclusively PXE clients, set the boot filename option to the value "pxboot". If you have exclusively TCP/IP BOOT-PROM clients, set the boot filename option to the value "bpboot". In a mixed PXE and TCP/IP BOOT-PROM client environment, you must configure your DHCP or BOOTP server so that it provides the PXE clients with the "pxboot" boot loader, and the TCP/IP BOOT-PROM clients with the "bpboot" boot loader.
Saturday, April 24, 2010
Group Membership script
'groupName = inputbox("Please enter the name of the group:")
'dim FileName = Groupname
groupPath = getgrouppath(groupName)
if groupPath = "" then
objFile.WriteLine(objmember.samaccountname)
"' WHERE objectCategory = 'Group' and sAMAccountName = '" & groupname & "'"
cmd.activeconnection = cn
"' WHERE sAMAccountName = '" & GroupName & "'"
"' WHERE PrimaryGroupID = '" & PrimaryGroupID & "'"
"," & q & rs("givenName") & q)
Tuesday, April 20, 2010
Backup NTFS permissions
_________Adding a security group to a folder and maintain inheritance_________
C:\Program Files\Support Tools>icacls D:\data$\NTFS_PermTEST /Grant "domainname\
DLGTestGroup":(OI)(CI)F
(Be mindful of security group names... has to be prewindows 2000 name for groups)
__________________________________________________________________________
Subinacl.exe
http://www.microsoft.com/downloads/details.aspx?FamilyID=E8BA3E56-D8FE-4A91-93CF-ED6985E3927B&displaylang=en
Here is example syntax that you can use to proactively back up your NTFS permissions:
Subinacl /noverbose /output=c:\ntfs_perms.txt /subdirectories "Path to the Folder of NTFS permissions we have to Backup"
To backup the permissions of the folder, subfolders and files on folder called Data\IT on the D: drive:
subinacl /noverbose /output=c:\ntfs_perms_TEST.txt /subdirectories D:\data\IT
If you wanted to just backup the NTFS permissions for the entire drive, the command would look like this:
subinacl /noverbose /output=c:\ntfs_D_drive_perms.txt /subdirectories D:\*.*
Most of you will probably not be concerned with backing up down to the file level, and are satisfied with just backing up the permissions at the directory level. Backing up the permissions for just the directories can be achieved with the following syntax:
subinacl /noverbose /output=c:\D_drive_NTFSperms.txt /subdirectories=directoriesonly D:\*.*
The output of the command while have something like this:
Elapsed Time: 00 00:00:00
Done: 5, Modified 5, Failed 0, Syntax errors 0
Last Done : D:\data$\IT\NTFS_PermTEST\TestA\Test_A_2\Inherit_notAllowed
The contents of the file created by subinacl are viewable in any text editor and the output is similar to this:
===================================
+File D:\data$\NTFS_PermTEST\TestA
===================================
/control=0x400
/owner =builtin\administrators
/primary group =domainname\domainname users
/audit ace count =0
/perm. ace count =5
/pace =domainname\A.B Type=0x0 Flags=0x13 AccessMask=0x1301bf
/pace =domainname\domainname admins Type=0x0 Flags=0x13 AccessMask=0x1f01ff
/pace =domainname\gav Type=0x0 Flags=0x13 AccessMask=0x1200a9
/pace =domainname\gsg-information technology Type=0x0 Flags=0x13 AccessMask=0x1f01ff
/pace =domainname\rahul Type=0x0 Flags=0x13 AccessMask=0x1f01ff
===================================
+File D:\data$\NTFS_PermTEST\TestB
===================================
/control=0x400
/owner =builtin\administrators
/primary group =domainname\domainname users
/audit ace count =0
/perm. ace count =5
/pace =domainname\A.B Type=0x0 Flags=0x13 AccessMask=0x1301bf
/pace =domainname\domainname admins Type=0x0 Flags=0x13 AccessMask=0x1f01ff
/pace =domainname\gav Type=0x0 Flags=0x13 AccessMask=0x1200a9
/pace =domainname\gsg-information technology Type=0x0 Flags=0x13 AccessMask=0x1f01ff
/pace =domainname\rahul Type=0x0 Flags=0x13 AccessMask=0x1f01ff
=======================================
To restore the permissions on the drive using the file that you backed them up to:
Subinacl /playfile c:\D_drive_NTFS_perms.txt
Monday, April 19, 2010
Simple explanation to Win2003 AD groups
Amateurs: Use only Universal Groups and never Global or Domain Local
What are the two TYPES of Groups in Windows Server 2003? Hang on Guy, I thought there were three, Global, Domain Local, and Universal? Microsoft are playing games with words, the two TYPES of groups are Security and Distribution (as in Distribution List).
Microsoft have introduced the Scope attribute to explain the capabilities of groups. If you are brand new to groups it makes sense, but for old timers it takes a while to get your head around the scope concept.
Active Directory Training
As an MCT trainer, I can thoroughly recommend TrainSignal because they provide practical hands on training. In particular, I like the way that TrainSignal cover all learning methods, instructor lead, video and of course text material. You can either take one module, for example Active Directory or go for a combination of modules. See more about Active Directory training
Domain Local Groups (These used to be plain Local groups).
Think of domain local groups as great hosts, literally anyone can be a member, users, Global groups, Universal groups, even computers can join a domain local group. Local groups are bad travellers and only operate in their own domain.
Best practice is to use local groups to assign permissions to resources like databases and printers.
Global Groups
These are great travellers, they can wander the entire Forest. The key point is that global groups are poor hosts and can only contain members from their own domain.
Best practice is to make global group your default group, and for starters, make a group to represent each of your departments.
Universal Groups
Another question for you, why is it sometimes the radio button against create Universal group is greyed out? The answer is when the Domain is in mixed mode you cannot create universal groups (NT 4.0 BDC's would not understand them). You need to 'raise domain level to Windows 2000 native before you benefit from universal groups. Think of universal groups as the ultimate container for nesting groups. They are good hosts and great travellers.
Best practice is make it rule to only include global groups inside Universal groups, no individual groups.
Global Catalog Implications
As you would expect, domain local and global groups are listed in the global catalog, however the individual members are not listed. So changes in global group membership have zero impact on global catalog replication traffic.
Universal groups on the other hand, not only are listed in the global catalog but also the individual users or nested groups are also listed. Now you can see that adding users to a universal group will generate replication traffic. That is why Guy says only put global groups inside universal groups, the individual members inside the global groups are not replicated.
In Windows 2000 the situation is that one change of membership to a universal group causes the whole list to be replicated, thankfully that changed in Server 2003, now only incremental changes are replicated not the whole list.
Thursday, April 15, 2010
Monday, April 12, 2010
connect to windows share from ESX Server
First you need to enable samba services on your ESX server’s firewall:
(from the ESX server console)
esxcfg-firewall -e smbClient
Create location on the esx server to mount the share to.
for e.g. mkdir /home/test
enable netfs – netfs is a file system interface to the networking stack of the ESX OS
chkconfig netfs on
service netfs start
mount -t smbfs -o username=
user domain\username format if need be.
Saturday, April 3, 2010
Open two excel sheets and split them across two monitors
http://blog.drewery.net/2006/08/29/utilising-dual-monitors-with-microsoft-excel-2003/
Folder options -> File types tab ->
Select XLS -> Advanced -> Select OPEN -> add space and "%1" at the end of the string in
'Application used to perform action' field.
UNSelect USE DDE.... ok out of everything.
The above steps should enable you to split excel files across two monitors.
WIN 7 does not have FILE Types tab..... Win 7... this was not my idea... ;-)
Cheers
Thursday, March 18, 2010
VMcopy
Sometimes you would like to use your external USB drive to backup (transfer) your VMDK files directly from your ESX Server external USB drive. VMDK files are files with extention *.VMDK and those files are virtual hard disks of your virtual machines. You can also mount VMDK files directly into your Windows PC.
When you plug-in external USB drive to ESX host you need to enter some commands at the console. For those of you who don’t really know linux, there is some commands to remember. But they are not many…. -:) .
First of all you should know that not all filesystems are supported. For the supported ones there are those here:
* FAT32 read/write.
* Ext3 read/write
* NTFS read only (that means that you can’t use NTFS formated USB drives to copy your VMDK files, but you should create a partition with EXT3 or FAT32)
Now how-to copy data from Service Console to a USB device:
1. Plugin the external USB drive to your ESX host.
2. Run this command to find out to which device name the kernel assigned to it:
tail /var/log/dmesg
3. Now you will have to Run the following command to create a mount point (A mount point is a directory which a device or partition is attached to):
mkdir /mnt/usb
esx-how-to-mount-usb-drive
4. Run the following command to mount the drive ( When mounting, you must tell the mount command what is the device or partition you want to mount and what is the mount point. The mount point must be a directory that already exists on your system.:
mount /dev/[device_name] /mnt/usb -t [filesystem_type]
Please Note that you must:
* Replace [device_name] with your device name found in step 2
* Replace [filesystem_type] with vfat (FAT32) or ext3
5. After your copy(backup) you can type this command to unmount the device:
umount /dev/[device_name]
You might also want to export you VMDK files. Vmkstools is VMware ESX Server file system management tool. It is a program for creating and manipulating virtual disks, file systems, logical volumes and pyhsical storage device on the VMware ESX Server. Now what you need to do to export the VMDK (virtual disk)? You will use a command ‘vmfkstools’:
vmkfstools -i /vmfs/volumes/[datastore_name]/[vm_name]/[vm_name].vmdk /mnt/usb/[vm_name].vmdk -d 2gbsparse
And how-to import the VMDK (virtual disk):
vmkfstools -i /[path_to_USB_mount]/[vm_name].vmdk /vmfs/volumes/[datastore_name]/[vm_name]/[vm_name].vmdk
You might also want to copy the configuration files for a virtual machine. Those files are files with following extentions: *.vmx *.log *.nvram *.vmxf *.vmsd (you will not only copy the configuration files, but at the same time you will make a zip file in tar.gz format:
cd /vmfs/volumes/[datastore_name]/[vm_name]
tar -czvf [vm_name].tar.gz *.vmx *.log *.nvram *.vmxf *.vmsd
cp [vm_name].tar.gz /mnt/usb
Now you will be able to extract the configuration files of a virtual machine:
tar -xzvf [vm_name].tar.gz /vmfs/volumes/[datastore_name]/[vm_name]
Friday, March 5, 2010
Services.exe using up all your memory ? and windows hangs after launch?
After reading few forums, followed a suggestion by someone, to delete all logs from event logs.
This is the reasoning:
Whenever Windows recognises any failure either software/Hardware it makes a entry in the system log. And when you start your machine again this system log entry will be checked and Windows will try to search for a possible solution / or try to analyse the causes of failure.How to check this..
Click ctrl + alt + del – Open your task manager and click processes. And see how much memory the process services.exe is using, If it exceeds say 10%, you can be sure you are having the diagnostic problem.In the below picture the services.exe is running normally.
I did try the above option. and it did make a difference to the performance.
However, before i deleted the logs i found lot of the below warnings under app logs.
Event Type: Warning
Event Source: EvntAgnt
Event Category: None
Event ID: 3006
Date: 5/03/2010
Time: 10:17:13 AM
User: N/A
Computer: PRDSVRMGS
Description:
Error reading log event record. Handle specified is 691944. Return code from ReadEventLog is 87.
For more information, see Help and Support Center at http://go.microsoft.com/fwlink/events.asp.
Cheers
Rahul
Thursday, March 4, 2010
IIS Related issues... contact this guy....
http://www.iis-aid.com/
Friday, February 26, 2010
Recreate vmdk files for stuffed/corrupted VMs
ps -auxwww |grep -i
________________sample vmdk file________________
FIRST VMDK FILE CREATED ->
# Disk DescriptorFile
version=1
CID=e77e6a48
parentCID=ffffffff
createType="vmfs"
# Extent description
RW 52454274 (GEt this by dividing flat vmdk size value with 512) VMFS "TST-DB01-flat.vmdk"
# The Disk Data Base
#DDB
ddb.adapterType = "buslogic"
ddb.geometry.sectors = "63"
ddb.geometry.heads = "255" (if flat file bigger then 2 gb)
ddb.geometry.cylinders = "3265" (Get this by dividing FLAT VMDK file size by 8225280
ddb.uuid = "60 00 C2 95 5b 34 57 49-ad 95 7c 96 81 c1 b0 f3"
ddb.toolsVersion = "7302"
ddb.virtualHWVersion = "4"
_______VMDK desc file of a snapshot of the vm_______________
# Disk DescriptorFile
version=1
CID=7dec0e38
parentCID=e77e6a48 (need to chain it with parent)
createType="vmfsSparse"
parentFileNameHint="PDC-TST-DB01.vmdk" (this should be the desc file not flat file)
# Extent description
RW 52454274 VMFSSPARSE "PDC-TST-DB01-000001-delta.vmdk"
# The Disk Data Base
#DDB
____________________________END OF FILE______________________________
VMX file of the above machine, Notice it has two disks mentioned below, but i havent put the vmdk for the second disk
____________________________________
#!/usr/bin/vmware
config.version = "8"
virtualHW.version = "4"
floppy0.present = "false"
nvram = "PDC-TST-DB01.nvram"
deploymentPlatform = "windows"
virtualHW.productCompatibility = "hosted"
tools.upgrade.policy = "manual"
powerType.powerOff = "default"
powerType.powerOn = "default"
powerType.suspend = "default"
powerType.reset = "default"
displayName = "PDC-TST-DB01"
extendedConfigFile = "PDC-TST-DB01.vmxf"
scsi0.present = "true"
scsi0.sharedBus = "none"
memsize = "1024"
scsi0:0.present = "true"
scsi0:0.fileName = "PDC-TST-DB01-000001.vmdk"
scsi0:0.deviceType = "scsi-hardDisk"
sched.scsi0:0.shares = "normal"
scsi0:1.present = "true"
scsi0:1.fileName = "PDC-TST-DB01_1-000001.vmdk"
scsi0:1.deviceType = "scsi-hardDisk"
sched.scsi0:1.shares = "normal"
ide0:0.present = "true"
ide0:0.fileName = "/dev/scd0"
ide0:0.deviceType = "atapi-cdrom"
ethernet0.present = "true"
ethernet0.wakeOnPcktRcv = "false"
ethernet0.networkName = "PROTECTED"
ethernet0.addressType = "vpx"
ethernet0.generatedAddress = "00:50:56:a5:39:c6"
guestOS = "winnetstandard"
uuid.bios = "50 25 c5 2f 02 02 71 ec-bf 14 72 2e f9 39 df 77"
log.fileName = "vmware.log"
snapshot.action = "keep"
sched.cpu.min = "0"
sched.cpu.units = "mhz"
sched.cpu.shares = "normal"
sched.mem.minsize = "0"
sched.mem.shares = "normal"
scsi0:0.redo = ""
scsi0:1.redo = ""
vmware.tools.requiredversion = "7302"
dMotion.enabled = "FALSE"
tools.syncTime = "FALSE"
uuid.location = "56 4d 37 d2 4d 30 08 fd-a0 18 c9 93 90 9a 28 a4"
migrate.hostlog = "./PDC-TST-DB01-07f9ca4f.hlog"
sched.mem.max = "1024"
sched.swap.derivedName = "/vmfs/volumes/488ad642-565ee789-4ece-001f2963b16a/PDC-TST-DB01/PDC-TST-DB01-07f9ca4f.vswp"
scsi0:0.DMotionParent = ""
scsi0:1.DMotionParent = ""
workingDir = "."
cpuid.1.ecx = "x----0----0--0-R-----------0-0--"
cpuid.1.ecx.amd = "x---------------------------0---"
cpuid.80000001.ecx.amd = "------------------00-00---------"
cpuid.80000001.edx = "----H---------------------------"
hostCPUID.0 = "0000000a756e65476c65746e49656e69"
guestCPUID.0 = "0000000a756e65476c65746e49656e69"
userCPUID.0 = "0000000a756e65476c65746e49656e69"
hostCPUID.1 = "0001067600040800000ce3bdbfebfbff"
guestCPUID.1 = "0001067800010800000822010febbbff"
userCPUID.1 = "0001067600040800000822010febbbff"
hostCPUID.80000001 = "00000000000000000000000120000000"
guestCPUID.80000001 = "00000000000000000000000120000000"
userCPUID.80000001 = "00000000000000000000000120000000"
evcCompatibilityMode = "FALSE"
scsi0:2.present = "false"
scsi0:2.fileName = "PDC-TST-DB01_2.vmdk"
scsi0:2.mode = "independent-persistent"
scsi0:2.deviceType = "scsi-hardDisk"
scsi0:2.redo = ""
Tuesday, February 23, 2010
Websense Policy server won't start
Had to take out 'WebsenseDb' account from the local admin group, bcos the websense policy database service was starting and stopping with the message that it had nothing to do.
After taking of the account from the local admin group, it remained in started mode.
Policy broker was started next,
Policy Server
Network agent,
user service
and the rest after that
Go figure...
Any explanation on how the about would make a different to the service would be great help.
Cheers
rahul
Monday, February 22, 2010
The SQL Server Agent (MSSQLSERVER) service on local computer started and then stopped
Unable to start SQL Server Agent
We are unable to start SQL Server Agent. It was giving the following error when we were trying to start it from the services console
The SQL Server Agent (MSSQLSERVER) service on Local Computer started and then stopped. Some services stop automatically if they have no work to do, for example, the Performance Logs and Alerts service.
When we try to change the service account for SQL Server Agent we get the below error,
The process terminated unexpectedly. [0x8007042b]
Tried to start SQL Server Agent from the command prompt using:
SQLAGENT90 -C -V>C:\SQLAGENT.OUT
SQLAGENT.OUT:
Unable to rename C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.OUT to C:\ProgramFiles\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.1 (reason: The system cannot find the path specified)
2007-08-24 10:10:31 - ! [241] Startup error: Unable to initialize error reporting system (reason: The system cannot find the path specified)
2007-08-24 10:10:31 - ? [098] SQLServerAgent terminated (normally)
Resolution:
Checked the value of key ErrorLogFile in the following registry hive:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Microsoft SQL Server\MSSQL.1\SQLServerAgent
ErrorLogFile key had the below value:
C:\ProgramFiles\Microsoft SQL Server\MSSQL.1\MSSQL\LOG\SQLAGENT.out
However we did not had any such directory present on the machine. Also we did not had any SQLAgent log file.
Changed the value in the ErrorLogFile key to reflect the correct location of the log folder which was on a different drive.
After making the changes we were able to start the SQL Server Agent.
Wednesday, January 20, 2010
VbScript - Find mapped drives on remote PC
hope it helps.... did this to help out the helpdesk guys....
Note: pls leave a comment, would like to get feedback.
' It requires the pc name or ip address
' It requires the username of the user whose drive mapping you want to find out on the remote machine
' The script gets the logonsession id and username in the first part of the script and then passes it ot Mappedlogicaldisk to get the drive mappings.
' This script can be refined further to only report on network drive type. however, i cant be stuffed.
'Auth: Rahul & Help from Chris (he wants me to do documentation and indenting... i dont like him
Option explicit
Dim strComputer
Dim strusername
Dim objWMIService
Dim colLogonSession
Dim namevar1, name1, name2, namestr3, nametemp1
Dim logonidvar1, logonid1, logonid2, logonidstr3, logonidtemp1
Dim objSession, colDrives, objDrive
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\cimv2")
strcomputer = InputBox("Enter the PC Name")
strusername = InputBox("Enter the username")
("Select * From Win32_LoggedOnUser")
For Each objSession in colLogonSession
namevar1 = objSession.antecedent
logonidvar1 = objSession.dependent
Logonid1 = (instr(1,logonidvar1,"Logonid=""",1) + 9)
Logonid2 = len(Logonidvar1)
Logonidtemp1 = Logonid2 - Logonid1
Namestr3 = Mid(namevar1,name1,nametemp1)
logonidstr3 = Mid(logonidvar1,logonid1,logonidtemp1)
'wscript.echo namestr3
'wscript.echo logonidstr3
'Matching username and passing it on to Mappedlogicaldisk to get the network drive mappings.
IF lcase(namestr3) = lcase(strusername) THEN 'it is case sensitive
Set objWMIService = GetObject("winmgmts:" & "{impersonationLevel=impersonate}!\\" &_
strComputer & "\root\cimv2")
("Select * From Win32_MappedLogicalDisk Where Sessionid = '" & Logonidstr3 & "'")
Wscript.Echo "Drive letter: " & objDrive.DeviceID
Wscript.Echo "Network path: " & objDrive.ProviderName
Next
END IF
Hope it helps.... i did a bit of searching on google before i wrote it, didnt get much luck with googling....