GetObject and remote services 
Author Message
 GetObject and remote services

I use the script below to access to the services on my computer:

Set ComputerObj = GetObject("WinNT://MYDOMAIN/MYCOMPUTER,Computer")
Response.Write ComputerObj.Division

ComputerObj.Filter = Array("Service")

For Each Service in ComputerObj
    Response.Write "Service display name = " & Service.DisplayName
    Response.Write "<BR>"
    Response.Write "Service account name = " & Service.ServiceAccountName
    Response.Write "Service executable   = " & Service.Path
    Response.Write "Current status       = " & Service.Status
    Response.Write "<BR>"
Next

When I use the same script to access a remote computer in the same domain
(changed MYCOMPUTER with the new name) I receive a message error.
I think is a problem of policy and privileges. What I have to do?

Thanks



Mon, 10 Dec 2001 03:00:00 GMT  
 GetObject and remote services


Fri, 19 Jun 1992 00:00:00 GMT  
 GetObject and remote services
Sorry! I use an asp page via browser.


Quote:
> I use the script below to access to the services on my computer:

> Set ComputerObj = GetObject("WinNT://MYDOMAIN/MYCOMPUTER,Computer")
> Response.Write ComputerObj.Division

> ComputerObj.Filter = Array("Service")

> For Each Service in ComputerObj
>     Response.Write "Service display name = " & Service.DisplayName
>     Response.Write "<BR>"
>     Response.Write "Service account name = " & Service.ServiceAccountName
>     Response.Write "Service executable   = " & Service.Path
>     Response.Write "Current status       = " & Service.Status
>     Response.Write "<BR>"
> Next

> When I use the same script to access a remote computer in the same domain
> (changed MYCOMPUTER with the new name) I receive a message error.
> I think is a problem of policy and privileges. What I have to do?

> Thanks



Mon, 10 Dec 2001 03:00:00 GMT  
 GetObject and remote services


Fri, 19 Jun 1992 00:00:00 GMT  
 GetObject and remote services
In IIS, find the file in the MMC and remove the Anonymous authentication in
the File Security tab. Or if this file is in an admin-only directory, change
the directory security for the directory instead. If you're using Win9x, set
it to Basic/Clear Text (Use SSL for security) or if you're running NT, you
can use NTCR. I think the problem is the account you're running under is
IUSR_computername which doesn't have Administrative access over the network.

I have a similar script which runs fine as long as I use the WinNT object,
but if I try to run a WSHShell.Run("AT \\remotemachine 12:00 net start svc")
it fails every time with Access Denied. I'm trying to write a script that
with a single button click, stop the web services on the web server, stop
the Exchange services on the Exchange server, and send the shutdown (reboot)
command to the Proxy server which the web and Exchange services are bound to
(Because if you leave those services running and reboot the Proxy server,
even after Proxy comes back up the web & Exchange services won't be bound to
the external ports anymore. You have to stop & restart the services to
rebind them to Proxy).

Everything works fine except if I try to send the AT command to the Exchange
server to start its services in 5 minutes or so, enough time to allow Proxy
to come back up. The web services on the web server schedule just fine
because the script is running locally, but the AT \\exchange fails.

Anyone know why svc=GetObject("WinNT://computername/svc") svc.start works
but WSHShell.Run("AT \\computername 12:00 net start svc") fails?

Tim Andrews, MCSE, Sr. Systems Consultant
Langtech Systems Consulting
(800)480-8488 x495
http://www.langtech.com


Quote:
> Sorry! I use an asp page via browser.



> > I use the script below to access to the services on my computer:

> > Set ComputerObj = GetObject("WinNT://MYDOMAIN/MYCOMPUTER,Computer")
> > Response.Write ComputerObj.Division

> > ComputerObj.Filter = Array("Service")

> > For Each Service in ComputerObj
> >     Response.Write "Service display name = " & Service.DisplayName
> >     Response.Write "<BR>"
> >     Response.Write "Service account name = " &

Service.ServiceAccountName
Quote:
> >     Response.Write "Service executable   = " & Service.Path
> >     Response.Write "Current status       = " & Service.Status
> >     Response.Write "<BR>"
> > Next

> > When I use the same script to access a remote computer in the same
domain
> > (changed MYCOMPUTER with the new name) I receive a message error.
> > I think is a problem of policy and privileges. What I have to do?

> > Thanks



Mon, 10 Dec 2001 03:00:00 GMT  
 GetObject and remote services
Hi,
Trie this:

'--- Binding to a computer with alternate credentials
Const ADS_SECURE_AUTHENTICATION = &H00001
Set dso = GetObject("WinNT:")
adsPATH = "WinNT://" & computerName & ",computer"
Set com = dso.OpenDSObject(adsPATH, userName, password,
ADS_SECURE_AUTHENTICATION)

Hope this will help, I works for me.
Best Regards
PIERRE

-----Message d'origine-----

Publi : jeudi 24 juin 1999 16:31
Publi dans: microsoft.public.scripting.wsh
Conversation: GetObject and remote services
Objet: GetObject and remote services

I use the script below to access to the services on my computer:

Set ComputerObj = GetObject("WinNT://MYDOMAIN/MYCOMPUTER,Computer")
Response.Write ComputerObj.Division

ComputerObj.Filter = Array("Service")

For Each Service in ComputerObj
    Response.Write "Service display name = " & Service.DisplayName
    Response.Write "<BR>"
    Response.Write "Service account name = " &
Service.ServiceAccountName
    Response.Write "Service executable   = " & Service.Path
    Response.Write "Current status       = " & Service.Status
    Response.Write "<BR>"
Next

When I use the same script to access a remote computer in the same
domain
(changed MYCOMPUTER with the new name) I receive a message error.
I think is a problem of policy and privileges. What I have to do?

Thanks



Thu, 13 Dec 2001 03:00:00 GMT  
 
 [ 6 post ] 

 Relevant Pages 

1. Remote service pack deployment with remote scripting

2. Remote access to NT Service Manager

3. dynamic listbox (remote data service)

4. Remote access to NT Service Manager

5. Remote shell service

6. Remote NT Services

7. Start Remote Windows NT Service

8. Locally Remote Web services...

9. Problems with Remote Data Services

10. Request Variable being passed to Remote Data Services Object

11. Remote service pack deployment with script files

12. Starting a service on Remote machine

 

 
Powered by phpBB® Forum Software