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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Help w/running script against a remote server

Status
Not open for further replies.

coluen

MIS
Dec 18, 2002
3
US
I have added the following bit of code to an asp page. If I make strServerName the web server name it runs fine. If I use another server name I get a permision error.

Error Type:
(0x80041003)
/monitor/script.asp, line 28


I have IIS 5.0 installed. I am the network admin so I have the proper ntfs permisions on the remote machine. On the directory where the asp page is, I am not using anonymous auth. in IIS. I am using nt integrated only. I am beginning to get a bit frazzled. I am new to this and have read papers and tutorials. Is there some unwritten or "hushup your just a noob" rule that I am missing? Any suggestions or examples of how to do this would be helpfull.
Thanks for your help.


<%@LANGUAGE=&quot;VBSCRIPT&quot;%>
<%strServerName = &quot;someservername&quot;%>

<P>Disks for server: <%=strServerName%></P>
<TABLE align=left border=1 cellPadding=1 cellSpacing=1>
<TR>
<TD>Drive Letter</TD>
<TD>Volume Label</TD>
<TD>Size (MB)</TD>
<TD>Free Space (MB)</TD>
<TD>Free Space (%)</TD>

<%

' Get a list of queues
for each disk in GetObject(&quot;winmgmts:{impersonationLevel=impersonate}!//&quot; + strServerName)_
.InstancesOf(&quot;Win32_LogicalDisk&quot;)
if disk.DriveType = 3 then ' fixed disks only
Size = Int(disk.Size / (1024*1024))
Free = Int(disk.FreeSpace / (1024*1024))
%>
<TR>
<TD><%=disk.Name%></TD>
<TD><%=disk.VolumeName%></TD>
<TD><%=Size%></TD>
<TD><%=Free%></TD>
<TD><%=Int( Free / Size * 100 )%></TD></TR>
<%
end if
Next
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top