**DONOTDELETE**
(Lurker)
2005-03-02 03:56 PM
XNET.exe without adminrights


Hi

Is it possible to run XNET.exe without admin privileges ?
My script works fine but not without rights !!!

Maybe there are other ways to realise it ?

Bye
Sam


Bryce
(KiX Supporter)
2005-03-02 05:08 PM
Re: XNET.exe without adminrights

what are you doing with xnet?

**DONOTDELETE**
(Lurker)
2005-03-02 05:23 PM
Re: XNET.exe without adminrights

I would like to check, If a service is running or not

JochenAdministrator
(KiX Supporter)
2005-03-02 05:54 PM
Re: XNET.exe without adminrights

remotely ?

Map to ipc$ with admin account first


Bryce
(KiX Supporter)
2005-03-02 05:59 PM
Re: XNET.exe without adminrights

cant a normal user do just a "net start" to show a list of the running services?



Mart
(KiX Supporter)
2005-03-02 06:04 PM
Re: XNET.exe without adminrights

Something like this:

Code:

Shell '%comspec% /c net start | find /i "Service name goes here"'



And check @error after the above. @error will be 0 if service is found.

Ussed it to find a custom installed services and shut it down if found.
Works perfect.

Never ussed xnet so don't know about that.


Bryce
(KiX Supporter)
2005-03-02 06:06 PM
Re: XNET.exe without adminrights

Code:

Shell '%comspec% /c net start | find /i "Service name goes here" > nul'
If @ERROR
? "the service was not running"
EndIf





Mart
(KiX Supporter)
2005-03-02 06:08 PM
Re: XNET.exe without adminrights

Damn, you faster then me
Just doing an edit to add the @error stuff.


JochenAdministrator
(KiX Supporter)
2005-03-02 06:18 PM
Re: XNET.exe without adminrights

Why the heck would he then trying to use XNET.EXE ???
There'd be no sense in it if used locally


Kdyer
(KiX Supporter)
2005-03-02 06:51 PM
Re: XNET.exe without adminrights

WMIQUERY() should also address this need.

Kent


JochenAdministrator
(KiX Supporter)
2005-03-02 11:30 PM
Re: XNET.exe without adminrights

without admin privileges ?


Sealeopard
(KiX Master)
2005-03-03 02:21 AM
Re: XNET.exe without adminrights

The original poster is talking about remote access, thus, by default, admin privileges would be needed, unless remote access security is lowered to allow non-admin accounts to perform such tasks.

**DONOTDELETE**
(Lurker)
2005-03-03 11:26 AM
Re: XNET.exe without adminrights


I check with the loginscript if the service run or not, If not i will send a message and start it. The problem for me was, that the users didn't have admin rights and so the xnet.exe can't query the service database.
Now I will try it with the net start methode.

Thanks
Sam


**DONOTDELETE**
(Lurker)
2005-03-03 12:00 PM
Re: XNET.exe without adminrights


Yep

Works really fine, but if I have services they have similar names

Windows Management Instrumentation Driver Extensions
Windows Management Instrumentation

there I have the next problem, if I would only check the Windows Management Instrumentation service.

Do you have an idea, how tho check that ?

Bye
Sam


Les
(KiX Master)
2005-03-03 02:54 PM
Re: XNET.exe without adminrights

Put the full name in quotes.

**DONOTDELETE**
(Lurker)
2005-03-03 05:08 PM
Re: XNET.exe without adminrights


I have checked it, that didn't work


Bryce
(KiX Supporter)
2005-03-03 05:26 PM
Re: XNET.exe without adminrights

you will have to look into using WSHpipe() then.

Code:

$service = "Windows Management Instrumentation"
$netstart = Split(Join(Split(Join(wshpipe("net start",1),"")," "),""),CHR(13))

If AScan($netstart,$service)+1
? "The service " + $service + " is running"
Else
? "The service " + $service + " is NOT running"
EndIf



**DONOTDELETE**
(Lurker)
2005-03-07 03:42 PM
Re: XNET.exe without adminrights


that doesnt work
error comma fails


JochenAdministrator
(KiX Supporter)
2005-03-07 04:23 PM
Re: XNET.exe without adminrights

Allright Samuel,

show us the line with which you check services with net start.
If you say it works ok for your users but not with quoted Service names then you simply have a syntax error somewhere in there (NO need to use wshpipe shtuff)


Bryce
(KiX Supporter)
2005-03-07 04:45 PM
Re: XNET.exe without adminrights

the problem is this

Quote:


Windows Management Instrumentation Driver Extensions
Windows Management Instrumentation





he wants to check for the service "Windows Management Instrumentation" to see if it is running.

if you run this.

shell '%comspec% /c net start | find /i "Windows Management Instrumentation" > nul'

and are depending on FIND's setting of the @error to determin if "Windows Management Instrumentation" is running or not. you will get a false positive if "Windows Management Instrumentation Driver Extensions" is running and "Windows Management Instrumentation" is not running.

the FIND command will find both of these....

Windows Management Instrumentation Driver Extensions
Windows Management Instrumentation




JochenAdministrator
(KiX Supporter)
2005-03-07 05:09 PM
Re: XNET.exe without adminrights

Oh ... all right, if you say so Bryce

Bryce
(KiX Supporter)
2005-03-07 05:44 PM
Re: XNET.exe without adminrights

It’s easy to test...

Put

Quote:


Windows Management Instrumentation Driver Extensions
Windows Management Instrumentation





Into a text file. And do this from a command prompt.


Type test.txt | find /i "Windows Management Instrumentation"


The find command finds both strings. Now remove "Windows Management Instrumentation" from the test file.... and the find command will find "Windows Management Instrumentation Driver Extensions" even if you were searching for "Windows Management Instrumentation"





desquinn
(Fresh Scripter)
2005-03-07 10:13 PM
Re: XNET.exe without adminrights

might be better using findstr or grep then with a regular expression

JochenAdministrator
(KiX Supporter)
2005-03-08 08:49 AM
Re: XNET.exe without adminrights

with that way one won't be doomed to rely on wsh which might be disbaled for security reasons in the enterprise environment.

Findtsr would be sufficient used with the /X switch, no? Plus it will be most probably available on any M$ OS ...


desquinn
(Fresh Scripter)
2005-03-08 12:10 PM
Re: XNET.exe without adminrights

not sure of os coverage for findstr but it is on 2000 and XP.

you can use /x /e or a regular expression.


NTDOCAdministrator
(KiX Master)
2005-03-08 08:05 PM
Re: XNET.exe without adminrights

Well FIND has been around since MS-DOS 2.0 so I think it will be safe to use for you

desquinn
(Fresh Scripter)
2005-03-09 12:56 AM
Re: XNET.exe without adminrights

but find does not cut it in this situation as it will provide a false positive since it does not support regular expressions, the concept of an exact match, or any idea of beginning or end of line.

to be honest findstr may be available on a NT4 etc machine but I cant remember. I can only say for definite that findstr appears on xp and 2000.

And again grep is also an alternative that I would end up using as I am used to using it but findstr is just as suitable and may be available as part of the OS


**DONOTDELETE**
(Lurker)
2005-03-09 04:46 PM
Re: XNET.exe without adminrights


thanks for your ideas.


JochenAdministrator
(KiX Supporter)
2005-03-09 05:23 PM
Re: XNET.exe without adminrights

Findstr on NT 4 (3.51) ?? Definetly there, yeah