PC Review


Reply
Thread Tools Rate Thread

c# widows services...

 
 
jj
Guest
Posts: n/a
 
      14th Jul 2006
I have a changed my simple windows form application to simple service. It
collects file information.
My application uses WMI and I can collect file attributes from shared and
other nodes in the network.

However, with my service I can collect file attribute info only from the
local machine the servie is running NOT from other nodes.

Can somebody help me here....
Newbie here
thanks


 
Reply With Quote
 
 
 
 
=?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
Guest
Posts: n/a
 
      15th Jul 2006
How do you propose to collect information from "nodes" on another machine (on
the network I assume) -- you don't specify. Your Windows Service runs under
certain credentials, that you can control. If the account it is running under
can't access folders on another machine, then it's up to you to change that.
Peter

--
Co-founder, Eggheadcafe.com developer portal:
http://www.eggheadcafe.com
UnBlog:
http://petesbloggerama.blogspot.com




"jj" wrote:

> I have a changed my simple windows form application to simple service. It
> collects file information.
> My application uses WMI and I can collect file attributes from shared and
> other nodes in the network.
>
> However, with my service I can collect file attribute info only from the
> local machine the servie is running NOT from other nodes.
>
> Can somebody help me here....
> Newbie here
> thanks
>
>
>

 
Reply With Quote
 
John Duval
Guest
Posts: n/a
 
      15th Jul 2006
Hi jj,
If you look in the control panel at your service's properties (Log On
tab), you will probably see that your service is running under the
Local System account. When a process runs under this account, it has
different privileges than a process that runs interactively. One of
the major differences is that it does not have access to network
resources. You can verify this by changing the service to run under a
different account (pick "This account:") which does have the privileges
to access network resources.

Another major difference when running under the Local System account is
that you don't (by default) have access to the desktop session of the
logged in user. This means that if you try to have your service pop up
windows, etc... it might not work. The "interact with desktop" is
meant to solve this.

Hope this helps,
John

jj wrote:
> I have a changed my simple windows form application to simple service. It
> collects file information.
> My application uses WMI and I can collect file attributes from shared and
> other nodes in the network.
>
> However, with my service I can collect file attribute info only from the
> local machine the servie is running NOT from other nodes.
>
> Can somebody help me here....
> Newbie here
> thanks


 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      15th Jul 2006
Please post your code or at least the part that deals with the WMI
connection.

Willy.

"jj" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
|I have a changed my simple windows form application to simple service. It
| collects file information.
| My application uses WMI and I can collect file attributes from shared and
| other nodes in the network.
|
| However, with my service I can collect file attribute info only from the
| local machine the servie is running NOT from other nodes.
|
| Can somebody help me here....
| Newbie here
| thanks
|
|


 
Reply With Quote
 
Willy Denoyette [MVP]
Guest
Posts: n/a
 
      15th Jul 2006
This is not the OP's issue. Using WMI (and it's wrapper classes in
System.Management) you have to specify explicit credentials to connect to
remote WMI services when connecting from a process that runs as a local
account.

Willy.

"John Duval" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
| Hi jj,
| If you look in the control panel at your service's properties (Log On
| tab), you will probably see that your service is running under the
| Local System account. When a process runs under this account, it has
| different privileges than a process that runs interactively. One of
| the major differences is that it does not have access to network
| resources. You can verify this by changing the service to run under a
| different account (pick "This account:") which does have the privileges
| to access network resources.
|
| Another major difference when running under the Local System account is
| that you don't (by default) have access to the desktop session of the
| logged in user. This means that if you try to have your service pop up
| windows, etc... it might not work. The "interact with desktop" is
| meant to solve this.
|
| Hope this helps,
| John
|
| jj wrote:
| > I have a changed my simple windows form application to simple service.
It
| > collects file information.
| > My application uses WMI and I can collect file attributes from shared
and
| > other nodes in the network.
| >
| > However, with my service I can collect file attribute info only from the
| > local machine the servie is running NOT from other nodes.
| >
| > Can somebody help me here....
| > Newbie here
| > thanks
|


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Multiple services, separate service installers, starting only one in services panel, but all services run sdstraub@gmail.com Microsoft VB .NET 2 29th Aug 2006 09:43 AM
Widows XP =?Utf-8?B?R3JhaGFtIEpvbmVz?= Windows XP Help 2 8th Apr 2006 11:52 PM
widows xp will not load on pc dipa Windows XP Hardware 0 21st Sep 2004 09:04 AM
Widows XP djm Windows XP General 4 9th Apr 2004 04:03 AM
Widows Update Microsoft Windows 2000 Windows Updates 1 29th Jan 2004 11:48 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 07:35 PM.