Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations biv343 on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

DomainString in logon script generates Event 560 1

Status
Not open for further replies.

porkchopexpress

IS-IT--Management
May 26, 2005
3,996
GB
I'm not sure if this is a VB question or a Windows question but i'm thinking someone will be able to help.

I have a logon script that maps drives and printers at logon which works very well the only issue is that every time someone logs on a object access failure audit is logged which is a pain. I've narrowed it down to which line causes it but i'm unsure what to change to stop the even logging.


This is the line

Code:
DomainString = objDomain.Get("dnsHostName")

and the event

Code:
Object Open:
 	Object Server:	SC Manager
 	Object Type:	SC_MANAGER OBJECT
 	Object Name:	ServicesActive
 	Handle ID:	-
 	Operation ID:	{0,478729559}
 	Process ID:	680
 	Image File Name:	C:\WINDOWS\system32\services.exe
 	Primary User Name:	SERVER$
 	Primary Domain:	DOMAIN
 	Primary Logon ID:	(0x0,0x3E7)
 	Client User Name:	USERNAME
 	Client Domain:	DOMAIN
 	Client Logon ID:	(0x0,0x1C88D505)
 	Accesses:	READ_CONTROL 
			Connect to service controller 
			Enumerate services 
			Query service database lock state 
			
 	Privileges:	-
 	Restricted Sid Count:	0
 	Access Mask:	0x20015

Has anyone seen this before when using VB logon scripts?

Thanks.
 
Is there any "on error" code? If there isn't, you could try
Code:
on error resume next
Then any errors you get will be ignored.
 
I have on error resume next in the script but the scritp doesn't generate the error, the error is picked up by an object access faliure audit.
 
Need to see how you have declared objDomain.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
If this line
[tt]> [/tt]DomainString = objDomain.Get("dnsHostName")
generates event 560, try replace it with this.
[tt] DomainString = objDomain.dnsHostName[/tt]
The event by itself is by large benigne in nature.
 
tsuji: Replacing the line didn't make any differece but i think it's actually the get username section that is causing the problem.

Mark: I've posted the problem area below.

Cheers.


Code:
On Error Resume Next


Dim WSHShell, WSHNetwork, objDomain, DomainString, UserString, UserObj, Path


Set WSHShell = CreateObject("WScript.Shell")
Set WSHNetwork = CreateObject("WScript.Network")
Set Network = CreateObject("Wscript.Network") 
'Automatically find the domain name
Set objDomain = getObject("LDAP://rootDse")
DomainString = objDomain.Get("dnsHostName")


'Grab the user name
UserString = WSHNetwork.UserName
Set UserObj = GetObject("WinNT://" & DomainString & "/" & UserString)
 
Yes it's the Set UserObj line that is causing the problem, this is used later to query for group membership when mapping drives.
 
Ah, that code all looks familiar. :)

Sounds to me like there is a DNS issue in your environment.

Give this line a try instead.

DomainString = Wshnetwork.UserDomain

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Yes i've been using your logon script for a while :) but i hadn't used this section on this domain. I'm pretty sure that DNS is configured correctly what kind of misconfig do you think could cause this?

I'll give the other line a try and let you know.

Cheers Mark.
 
Verify that your clients don't have ISP DNS configured on their NICs.

DNS Settings

Set all static NIC TCP/IP properties to only list internal DNS servers.

In DHCP set the DNS setting to internal DNS servers.

In DNS, configure ISP DNS on the forwarders tab.

**********************************

I've seen this problem a few times with some of my Admin Script Pack subscribers, but have never been given a chance to troubleshoot the issue in depth. I believe it POSSIBLY has to do with using non standard naming conventions. Can you share what the fully qualified domain name is and the netbios domain name?

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
The DNS basics are setup correctly the only place the ISP's IP is listed is in the forwarders on the DNS server all clients receive their DNS from DHCP and point to our DNS server.

Netdiag and DCdiag don't flag any issues.

The internal DNS is bcs.sch.uk, netbios is just BCS.
 
Oh and the DomainString = Wshnetwork.UserDomain line has solved it for now so i'll sling you a star ;-)
 
Thanks porkchopexpress. I have seen this same problem when the domain name ended in .UK before.

What I suspect is the real problem is that the name has 3 parts. I would bet that if the name was just sch.uk it would probably work. I think this is a bug in vbscript.

Any chance I could get you to install WSH5.7 and test that portion again? Just curious if MS fixed the issue or not in the latest release.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Hi Mark

I installed WSH 5.7 on a client and i got the same 560 error in the server event log. I'm pretty happy with it now it's not filling my event log, i'm surprised this doesn't pop up as an issue more often there must be a few three part domain names out there.

Cheers

Grant.

 
Thanks for trying the 5.7 update. I'll update my FAQ to avoid this in the future.

I hope you find this post helpful.

Regards,

Mark

Check out my scripting solutions at
Work SMARTER not HARDER. The Spider's Parlor's Admin Script Pack is a collection of Administrative scripts designed to make IT Administration easier! Save time, get more work done, get the Admin Script Pack.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top