Werbung: SecurityConsole.de verwaltet Ihre Computer mit Security Essentails aus der Cloud!
30 Tage kostenfrei testen und 20% Rabatt für Ihre Bestellung mit Promocode: WBF2685582
(Promocode gültig bis 31.12.2011)

Group:  English: Windows Server » microsoft.public.windows.server.scripting
Thread: Script Help

HTVi
TV Discussion Newsgroups

Script Help
Jmnts 10/16/2008 11:48:01 PM
Hi everyone,
I have 2 questions I hope that script experts could help me.

1-
I've a huge task to complete.

It's my job to get a list among dozens of servers (2000 and 2003) a list of
the users that logged on those servers (the servers have local and domain
users) and related properties especially:

-User Name
-Description
-Last time that the user logged on that server (this is very important, and
remember that I’ve local users and domain users that logs on the servers, I
only need to know the last time that they logged on that particular server).
-State (enabled or disabled)

- I don’t have much experience with scripting but I can’t find nothing that
has this particular needs.

2-
I use a batch file with xcopy that copies files and folders between
computers/servers, however when copying “for example” a directory, with
always ask me for destination F=File or D=Directory, is there any way to
provide the answer automatically

Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a directory)
/S

Thank you all for the help that you can provide.

Re: Script Help
"Pegasus \(MVP\)" <I.can[ at ]fly.com.oz> 10/17/2008 6:05:28 AM

"Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
news:F0FA7F70-7CC0-4CB6-A243-C06045345E2E[ at ]microsoft.com...
[Quoted Text]
> Hi everyone,
> I have 2 questions I hope that script experts could help me.
>
> 1-
> I've a huge task to complete.
>
> It's my job to get a list among dozens of servers (2000 and 2003) a list
> of
> the users that logged on those servers (the servers have local and domain
> users) and related properties especially:
>
> -User Name
> -Description
> -Last time that the user logged on that server (this is very important,
> and
> remember that I've local users and domain users that logs on the servers,
> I
> only need to know the last time that they logged on that particular
> server).
> -State (enabled or disabled)
>
> - I don't have much experience with scripting but I can't find nothing
> that
> has this particular needs.
>
> 2-
> I use a batch file with xcopy that copies files and folders between
> computers/servers, however when copying "for example" a directory, with
> always ask me for destination F=File or D=Directory, is there any way to
> provide the answer automatically
>
> Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a directory)
> /S
>
> Thank you all for the help that you can provide.
>

1. There is a lot of relevant stuff on Richard Mueller's site:
http://www.rlmueller.net/products.htm
http://www.rlmueller.net/freecode2.htm
http://www.rlmueller.net

2. You have a couple of options:
a) Add a trailing backslash:
xcopy /s "Source Folder" "Destination Folder\"
b) Pipe a "D" into the command:
echo D|xcopy /s "Source Folder" "Destination Folder"
Note that xcopy.exe is now deprecated. If fails occasionally on large jobs.
Use robocopy instead.


Re: Script Help
Jmnts 10/17/2008 1:29:00 PM
Hi Pegasus you're very helpfull.

Although the rlmueller is an excellent site with lots of script solutions, I
cannot find anything to my particular scenario!!! I need to run the script
against the servers and take all users info that logged on that server, last
time they logged, description, if is a local user or domain user!!!

Do you think that is possible with script? I already found some samples
(WMI) I downloaded the WMI code creator and scriptomatic and I used the
Win32_UserAccount, but this doesn't give me the last time that they logged on?

I'm starting going crazy with this... :(

For example I also nee to get software installed on those servers, again I
used scriptomatic to create a script with Win32_Product, guess what?? Not all
installed software is returned?? Why? I did a test on a server with SQL
installed and the SQL wasn't listed??

Perhaps I'm using the wrong classes I don't know... All I know is that I
need the list for all these tasks and I have nothing so far...

Thank you for your time.

"Pegasus (MVP)" wrote:

[Quoted Text]
>
> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
> news:F0FA7F70-7CC0-4CB6-A243-C06045345E2E[ at ]microsoft.com...
> > Hi everyone,
> > I have 2 questions I hope that script experts could help me.
> >
> > 1-
> > I've a huge task to complete.
> >
> > It's my job to get a list among dozens of servers (2000 and 2003) a list
> > of
> > the users that logged on those servers (the servers have local and domain
> > users) and related properties especially:
> >
> > -User Name
> > -Description
> > -Last time that the user logged on that server (this is very important,
> > and
> > remember that I've local users and domain users that logs on the servers,
> > I
> > only need to know the last time that they logged on that particular
> > server).
> > -State (enabled or disabled)
> >
> > - I don't have much experience with scripting but I can't find nothing
> > that
> > has this particular needs.
> >
> > 2-
> > I use a batch file with xcopy that copies files and folders between
> > computers/servers, however when copying "for example" a directory, with
> > always ask me for destination F=File or D=Directory, is there any way to
> > provide the answer automatically
> >
> > Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a directory)
> > /S
> >
> > Thank you all for the help that you can provide.
> >
>
> 1. There is a lot of relevant stuff on Richard Mueller's site:
> http://www.rlmueller.net/products.htm
> http://www.rlmueller.net/freecode2.htm
> http://www.rlmueller.net
>
> 2. You have a couple of options:
> a) Add a trailing backslash:
> xcopy /s "Source Folder" "Destination Folder\"
> b) Pipe a "D" into the command:
> echo D|xcopy /s "Source Folder" "Destination Folder"
> Note that xcopy.exe is now deprecated. If fails occasionally on large jobs.
> Use robocopy instead.
>
>
>
Re: Script Help
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 10/17/2008 5:57:25 PM

"Pegasus (MVP)" <I.can[ at ]fly.com.oz> wrote in message
news:uJaQc5BMJHA.3080[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
>
> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
> news:F0FA7F70-7CC0-4CB6-A243-C06045345E2E[ at ]microsoft.com...
>> Hi everyone,
>> I have 2 questions I hope that script experts could help me.
>>
>> 1-
>> I've a huge task to complete.
>>
>> It's my job to get a list among dozens of servers (2000 and 2003) a list
>> of
>> the users that logged on those servers (the servers have local and domain
>> users) and related properties especially:
>>
>> -User Name
>> -Description
>> -Last time that the user logged on that server (this is very important,
>> and
>> remember that I've local users and domain users that logs on the servers,
>> I
>> only need to know the last time that they logged on that particular
>> server).
>> -State (enabled or disabled)
>>
>> - I don't have much experience with scripting but I can't find nothing
>> that
>> has this particular needs.
>>
>> 2-
>> I use a batch file with xcopy that copies files and folders between
>> computers/servers, however when copying "for example" a directory, with
>> always ask me for destination F=File or D=Directory, is there any way to
>> provide the answer automatically
>>
>> Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a
>> directory)
>> /S
>>
>> Thank you all for the help that you can provide.
>>
>
> 1. There is a lot of relevant stuff on Richard Mueller's site:
> http://www.rlmueller.net/products.htm
> http://www.rlmueller.net/freecode2.htm
> http://www.rlmueller.net
>
> 2. You have a couple of options:
> a) Add a trailing backslash:
> xcopy /s "Source Folder" "Destination Folder\"
> b) Pipe a "D" into the command:
> echo D|xcopy /s "Source Folder" "Destination Folder"

c) the /I switch tells xcopy do assume that a non-existent destination is a
folder.

> Note that xcopy.exe is now deprecated. If fails occasionally on large
> jobs. Use robocopy instead.

I heartily agree.

/Al


Re: Script Help
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 10/17/2008 6:03:14 PM

"Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
news:942C7AE6-29F6-4AF5-8FD7-D4651642D7E0[ at ]microsoft.com...
[Quoted Text]
> Hi Pegasus you're very helpfull.
>
> Although the rlmueller is an excellent site with lots of script solutions,
> I
> cannot find anything to my particular scenario!!!

Very often you will never find the exact solution to a problem - unless
someone else has had the exact problem before. Rather, you need to
understand information such as found on Richard's site, and figure out how
to adapt it to your situation.

> I need to run the script
> against the servers and take all users info that logged on that server,
> last
> time they logged, description, if is a local user or domain user!!!

Whether or not this can be done may depend on whether or not the information
has been logged in the past. You may need to enable some sort of auditing to
be able to do this in the future.

Alternately, you could look at the date of the NTUSER.DAT file in each
profile. I find that in our environment this is not always accurate.

> Do you think that is possible with script?

Yes - but only if the information is there somewhere.

> I already found some samples
> (WMI) I downloaded the WMI code creator and scriptomatic and I used the
> Win32_UserAccount, but this doesn't give me the last time that they logged
> on?
>
> I'm starting going crazy with this... :(
>
> For example I also nee to get software installed on those servers, again I
> used scriptomatic to create a script with Win32_Product, guess what?? Not
> all
> installed software is returned?? Why? I did a test on a server with SQL
> installed and the SQL wasn't listed??

I would suggest you start a different discussion thread on this other
unrelated issue, as combining the two issues in one thread is likely to
prove counterproductive.

/Al


> Perhaps I'm using the wrong classes I don't know... All I know is that I
> need the list for all these tasks and I have nothing so far...
>
> Thank you for your time.
>
> "Pegasus (MVP)" wrote:
>
>>
>> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
>> news:F0FA7F70-7CC0-4CB6-A243-C06045345E2E[ at ]microsoft.com...
>> > Hi everyone,
>> > I have 2 questions I hope that script experts could help me.
>> >
>> > 1-
>> > I've a huge task to complete.
>> >
>> > It's my job to get a list among dozens of servers (2000 and 2003) a
>> > list
>> > of
>> > the users that logged on those servers (the servers have local and
>> > domain
>> > users) and related properties especially:
>> >
>> > -User Name
>> > -Description
>> > -Last time that the user logged on that server (this is very important,
>> > and
>> > remember that I've local users and domain users that logs on the
>> > servers,
>> > I
>> > only need to know the last time that they logged on that particular
>> > server).
>> > -State (enabled or disabled)
>> >
>> > - I don't have much experience with scripting but I can't find nothing
>> > that
>> > has this particular needs.
>> >
>> > 2-
>> > I use a batch file with xcopy that copies files and folders between
>> > computers/servers, however when copying "for example" a directory, with
>> > always ask me for destination F=File or D=Directory, is there any way
>> > to
>> > provide the answer automatically
>> >
>> > Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a
>> > directory)
>> > /S
>> >
>> > Thank you all for the help that you can provide.
>> >
>>
>> 1. There is a lot of relevant stuff on Richard Mueller's site:
>> http://www.rlmueller.net/products.htm
>> http://www.rlmueller.net/freecode2.htm
>> http://www.rlmueller.net
>>
>> 2. You have a couple of options:
>> a) Add a trailing backslash:
>> xcopy /s "Source Folder" "Destination Folder\"
>> b) Pipe a "D" into the command:
>> echo D|xcopy /s "Source Folder" "Destination Folder"
>> Note that xcopy.exe is now deprecated. If fails occasionally on large
>> jobs.
>> Use robocopy instead.
>>
>>
>>


Re: Script Help
Jmnts 10/17/2008 6:30:34 PM
Ok thank you for your response.

Let me refrase, to you know any script to run on a given server that get a
list of domain users that logged on that server? And from that list get the
last logon that they did?


"Al Dunbar" wrote:

[Quoted Text]
>
> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
> news:942C7AE6-29F6-4AF5-8FD7-D4651642D7E0[ at ]microsoft.com...
> > Hi Pegasus you're very helpfull.
> >
> > Although the rlmueller is an excellent site with lots of script solutions,
> > I
> > cannot find anything to my particular scenario!!!
>
> Very often you will never find the exact solution to a problem - unless
> someone else has had the exact problem before. Rather, you need to
> understand information such as found on Richard's site, and figure out how
> to adapt it to your situation.
>
> > I need to run the script
> > against the servers and take all users info that logged on that server,
> > last
> > time they logged, description, if is a local user or domain user!!!
>
> Whether or not this can be done may depend on whether or not the information
> has been logged in the past. You may need to enable some sort of auditing to
> be able to do this in the future.
>
> Alternately, you could look at the date of the NTUSER.DAT file in each
> profile. I find that in our environment this is not always accurate.
>
> > Do you think that is possible with script?
>
> Yes - but only if the information is there somewhere.
>
> > I already found some samples
> > (WMI) I downloaded the WMI code creator and scriptomatic and I used the
> > Win32_UserAccount, but this doesn't give me the last time that they logged
> > on?
> >
> > I'm starting going crazy with this... :(
> >
> > For example I also nee to get software installed on those servers, again I
> > used scriptomatic to create a script with Win32_Product, guess what?? Not
> > all
> > installed software is returned?? Why? I did a test on a server with SQL
> > installed and the SQL wasn't listed??
>
> I would suggest you start a different discussion thread on this other
> unrelated issue, as combining the two issues in one thread is likely to
> prove counterproductive.
>
> /Al
>
>
> > Perhaps I'm using the wrong classes I don't know... All I know is that I
> > need the list for all these tasks and I have nothing so far...
> >
> > Thank you for your time.
> >
> > "Pegasus (MVP)" wrote:
> >
> >>
> >> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
> >> news:F0FA7F70-7CC0-4CB6-A243-C06045345E2E[ at ]microsoft.com...
> >> > Hi everyone,
> >> > I have 2 questions I hope that script experts could help me.
> >> >
> >> > 1-
> >> > I've a huge task to complete.
> >> >
> >> > It's my job to get a list among dozens of servers (2000 and 2003) a
> >> > list
> >> > of
> >> > the users that logged on those servers (the servers have local and
> >> > domain
> >> > users) and related properties especially:
> >> >
> >> > -User Name
> >> > -Description
> >> > -Last time that the user logged on that server (this is very important,
> >> > and
> >> > remember that I've local users and domain users that logs on the
> >> > servers,
> >> > I
> >> > only need to know the last time that they logged on that particular
> >> > server).
> >> > -State (enabled or disabled)
> >> >
> >> > - I don't have much experience with scripting but I can't find nothing
> >> > that
> >> > has this particular needs.
> >> >
> >> > 2-
> >> > I use a batch file with xcopy that copies files and folders between
> >> > computers/servers, however when copying "for example" a directory, with
> >> > always ask me for destination F=File or D=Directory, is there any way
> >> > to
> >> > provide the answer automatically
> >> >
> >> > Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a
> >> > directory)
> >> > /S
> >> >
> >> > Thank you all for the help that you can provide.
> >> >
> >>
> >> 1. There is a lot of relevant stuff on Richard Mueller's site:
> >> http://www.rlmueller.net/products.htm
> >> http://www.rlmueller.net/freecode2.htm
> >> http://www.rlmueller.net
> >>
> >> 2. You have a couple of options:
> >> a) Add a trailing backslash:
> >> xcopy /s "Source Folder" "Destination Folder\"
> >> b) Pipe a "D" into the command:
> >> echo D|xcopy /s "Source Folder" "Destination Folder"
> >> Note that xcopy.exe is now deprecated. If fails occasionally on large
> >> jobs.
> >> Use robocopy instead.
> >>
> >>
> >>
>
>
>
Re: Script Help
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 10/17/2008 9:22:56 PM

"Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
news:CF9127BE-235C-4E8B-8237-9283EF0F2B59[ at ]microsoft.com...
[Quoted Text]
> Ok thank you for your response.
>
> Let me refrase, to you know any script to run on a given server that get a
> list of domain users that logged on that server?

I believe there to be such scripts. I tend to use one of the pstools
utilities which is designed to do that very thing:

http://technet.microsoft.com/en-us/sysinternals/bb897545.aspx

> And from that list get the
> last logon that they did?

As I recall, psloggedon does that as well.

/Al

>
>
> "Al Dunbar" wrote:
>
>>
>> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
>> news:942C7AE6-29F6-4AF5-8FD7-D4651642D7E0[ at ]microsoft.com...
>> > Hi Pegasus you're very helpfull.
>> >
>> > Although the rlmueller is an excellent site with lots of script
>> > solutions,
>> > I
>> > cannot find anything to my particular scenario!!!
>>
>> Very often you will never find the exact solution to a problem - unless
>> someone else has had the exact problem before. Rather, you need to
>> understand information such as found on Richard's site, and figure out
>> how
>> to adapt it to your situation.
>>
>> > I need to run the script
>> > against the servers and take all users info that logged on that server,
>> > last
>> > time they logged, description, if is a local user or domain user!!!
>>
>> Whether or not this can be done may depend on whether or not the
>> information
>> has been logged in the past. You may need to enable some sort of auditing
>> to
>> be able to do this in the future.
>>
>> Alternately, you could look at the date of the NTUSER.DAT file in each
>> profile. I find that in our environment this is not always accurate.
>>
>> > Do you think that is possible with script?
>>
>> Yes - but only if the information is there somewhere.
>>
>> > I already found some samples
>> > (WMI) I downloaded the WMI code creator and scriptomatic and I used the
>> > Win32_UserAccount, but this doesn't give me the last time that they
>> > logged
>> > on?
>> >
>> > I'm starting going crazy with this... :(
>> >
>> > For example I also nee to get software installed on those servers,
>> > again I
>> > used scriptomatic to create a script with Win32_Product, guess what??
>> > Not
>> > all
>> > installed software is returned?? Why? I did a test on a server with SQL
>> > installed and the SQL wasn't listed??
>>
>> I would suggest you start a different discussion thread on this other
>> unrelated issue, as combining the two issues in one thread is likely to
>> prove counterproductive.
>>
>> /Al
>>
>>
>> > Perhaps I'm using the wrong classes I don't know... All I know is that
>> > I
>> > need the list for all these tasks and I have nothing so far...
>> >
>> > Thank you for your time.
>> >
>> > "Pegasus (MVP)" wrote:
>> >
>> >>
>> >> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
>> >> news:F0FA7F70-7CC0-4CB6-A243-C06045345E2E[ at ]microsoft.com...
>> >> > Hi everyone,
>> >> > I have 2 questions I hope that script experts could help me.
>> >> >
>> >> > 1-
>> >> > I've a huge task to complete.
>> >> >
>> >> > It's my job to get a list among dozens of servers (2000 and 2003) a
>> >> > list
>> >> > of
>> >> > the users that logged on those servers (the servers have local and
>> >> > domain
>> >> > users) and related properties especially:
>> >> >
>> >> > -User Name
>> >> > -Description
>> >> > -Last time that the user logged on that server (this is very
>> >> > important,
>> >> > and
>> >> > remember that I've local users and domain users that logs on the
>> >> > servers,
>> >> > I
>> >> > only need to know the last time that they logged on that particular
>> >> > server).
>> >> > -State (enabled or disabled)
>> >> >
>> >> > - I don't have much experience with scripting but I can't find
>> >> > nothing
>> >> > that
>> >> > has this particular needs.
>> >> >
>> >> > 2-
>> >> > I use a batch file with xcopy that copies files and folders between
>> >> > computers/servers, however when copying "for example" a directory,
>> >> > with
>> >> > always ask me for destination F=File or D=Directory, is there any
>> >> > way
>> >> > to
>> >> > provide the answer automatically
>> >> >
>> >> > Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a
>> >> > directory)
>> >> > /S
>> >> >
>> >> > Thank you all for the help that you can provide.
>> >> >
>> >>
>> >> 1. There is a lot of relevant stuff on Richard Mueller's site:
>> >> http://www.rlmueller.net/products.htm
>> >> http://www.rlmueller.net/freecode2.htm
>> >> http://www.rlmueller.net
>> >>
>> >> 2. You have a couple of options:
>> >> a) Add a trailing backslash:
>> >> xcopy /s "Source Folder" "Destination Folder\"
>> >> b) Pipe a "D" into the command:
>> >> echo D|xcopy /s "Source Folder" "Destination Folder"
>> >> Note that xcopy.exe is now deprecated. If fails occasionally on large
>> >> jobs.
>> >> Use robocopy instead.
>> >>
>> >>
>> >>
>>
>>
>>


Re: Script Help
Jmnts 10/18/2008 10:46:01 AM
Thanks for your time in this issue, unfortunately psloggedon doesn't do that,
it only shows logged users at the time of the query.

I'm searching and searching this... I can't believe that no one has a script
that queries users that logged on the server.

Thank you.


"Al Dunbar" wrote:

[Quoted Text]
>
> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
> news:CF9127BE-235C-4E8B-8237-9283EF0F2B59[ at ]microsoft.com...
> > Ok thank you for your response.
> >
> > Let me refrase, to you know any script to run on a given server that get a
> > list of domain users that logged on that server?
>
> I believe there to be such scripts. I tend to use one of the pstools
> utilities which is designed to do that very thing:
>
> http://technet.microsoft.com/en-us/sysinternals/bb897545.aspx
>
> > And from that list get the
> > last logon that they did?
>
> As I recall, psloggedon does that as well.
>
> /Al
>
> >
> >
> > "Al Dunbar" wrote:
> >
> >>
> >> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
> >> news:942C7AE6-29F6-4AF5-8FD7-D4651642D7E0[ at ]microsoft.com...
> >> > Hi Pegasus you're very helpfull.
> >> >
> >> > Although the rlmueller is an excellent site with lots of script
> >> > solutions,
> >> > I
> >> > cannot find anything to my particular scenario!!!
> >>
> >> Very often you will never find the exact solution to a problem - unless
> >> someone else has had the exact problem before. Rather, you need to
> >> understand information such as found on Richard's site, and figure out
> >> how
> >> to adapt it to your situation.
> >>
> >> > I need to run the script
> >> > against the servers and take all users info that logged on that server,
> >> > last
> >> > time they logged, description, if is a local user or domain user!!!
> >>
> >> Whether or not this can be done may depend on whether or not the
> >> information
> >> has been logged in the past. You may need to enable some sort of auditing
> >> to
> >> be able to do this in the future.
> >>
> >> Alternately, you could look at the date of the NTUSER.DAT file in each
> >> profile. I find that in our environment this is not always accurate.
> >>
> >> > Do you think that is possible with script?
> >>
> >> Yes - but only if the information is there somewhere.
> >>
> >> > I already found some samples
> >> > (WMI) I downloaded the WMI code creator and scriptomatic and I used the
> >> > Win32_UserAccount, but this doesn't give me the last time that they
> >> > logged
> >> > on?
> >> >
> >> > I'm starting going crazy with this... :(
> >> >
> >> > For example I also nee to get software installed on those servers,
> >> > again I
> >> > used scriptomatic to create a script with Win32_Product, guess what??
> >> > Not
> >> > all
> >> > installed software is returned?? Why? I did a test on a server with SQL
> >> > installed and the SQL wasn't listed??
> >>
> >> I would suggest you start a different discussion thread on this other
> >> unrelated issue, as combining the two issues in one thread is likely to
> >> prove counterproductive.
> >>
> >> /Al
> >>
> >>
> >> > Perhaps I'm using the wrong classes I don't know... All I know is that
> >> > I
> >> > need the list for all these tasks and I have nothing so far...
> >> >
> >> > Thank you for your time.
> >> >
> >> > "Pegasus (MVP)" wrote:
> >> >
> >> >>
> >> >> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
> >> >> news:F0FA7F70-7CC0-4CB6-A243-C06045345E2E[ at ]microsoft.com...
> >> >> > Hi everyone,
> >> >> > I have 2 questions I hope that script experts could help me.
> >> >> >
> >> >> > 1-
> >> >> > I've a huge task to complete.
> >> >> >
> >> >> > It's my job to get a list among dozens of servers (2000 and 2003) a
> >> >> > list
> >> >> > of
> >> >> > the users that logged on those servers (the servers have local and
> >> >> > domain
> >> >> > users) and related properties especially:
> >> >> >
> >> >> > -User Name
> >> >> > -Description
> >> >> > -Last time that the user logged on that server (this is very
> >> >> > important,
> >> >> > and
> >> >> > remember that I've local users and domain users that logs on the
> >> >> > servers,
> >> >> > I
> >> >> > only need to know the last time that they logged on that particular
> >> >> > server).
> >> >> > -State (enabled or disabled)
> >> >> >
> >> >> > - I don't have much experience with scripting but I can't find
> >> >> > nothing
> >> >> > that
> >> >> > has this particular needs.
> >> >> >
> >> >> > 2-
> >> >> > I use a batch file with xcopy that copies files and folders between
> >> >> > computers/servers, however when copying "for example" a directory,
> >> >> > with
> >> >> > always ask me for destination F=File or D=Directory, is there any
> >> >> > way
> >> >> > to
> >> >> > provide the answer automatically
> >> >> >
> >> >> > Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a
> >> >> > directory)
> >> >> > /S
> >> >> >
> >> >> > Thank you all for the help that you can provide.
> >> >> >
> >> >>
> >> >> 1. There is a lot of relevant stuff on Richard Mueller's site:
> >> >> http://www.rlmueller.net/products.htm
> >> >> http://www.rlmueller.net/freecode2.htm
> >> >> http://www.rlmueller.net
> >> >>
> >> >> 2. You have a couple of options:
> >> >> a) Add a trailing backslash:
> >> >> xcopy /s "Source Folder" "Destination Folder\"
> >> >> b) Pipe a "D" into the command:
> >> >> echo D|xcopy /s "Source Folder" "Destination Folder"
> >> >> Note that xcopy.exe is now deprecated. If fails occasionally on large
> >> >> jobs.
> >> >> Use robocopy instead.
> >> >>
> >> >>
> >> >>
> >>
> >>
> >>
>
>
>
Re: Script Help
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 10/18/2008 8:09:31 PM

"Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
news:13C03B0D-619B-4298-85DA-18163D83AA2F[ at ]microsoft.com...
[Quoted Text]
> Thanks for your time in this issue, unfortunately psloggedon doesn't do
> that,
> it only shows logged users at the time of the query.

My bad, sorry, I thought it provided the last logon time as well.

> I'm searching and searching this... I can't believe that no one has a
> script
> that queries users that logged on the server.

Well, if there were a script that could do such a query, where do you
suppose it would find that information? I don't know where it can be found.
I suspect that if this were possible, it might require that some specific
auditing be turned on for the purpose. I mentioned this in an earlier reply,
but you have apparently not looked into that.

I have a script that shows who logged on when and on what workstation, and I
am sure that many others do as well. The script will not work for you,
however, as it relies on information collected for it by our logon script.
It is not foolproof, however, it serves my purposes.

Pegasus gave you three links into Richard Meuller's site that you did not
seem to find useful. Here is one that gives an example of a logon script
that collects logon information:

http://www.rlmueller.net/Logon5.htm

Given the solution many of us have come up with, perhaps it is just true
that the information is simply not available from anywhere in the typical
configuration. I am quite sure that, if it were, someone would have
published a script that does precisely what you want.

You may eventually have to: "believe that no one has a script that queries
users that logged on the server". I know I am not lying when I tell you I
know of no such script.


/Al

> Thank you.
>
>
> "Al Dunbar" wrote:
>
>>
>> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
>> news:CF9127BE-235C-4E8B-8237-9283EF0F2B59[ at ]microsoft.com...
>> > Ok thank you for your response.
>> >
>> > Let me refrase, to you know any script to run on a given server that
>> > get a
>> > list of domain users that logged on that server?
>>
>> I believe there to be such scripts. I tend to use one of the pstools
>> utilities which is designed to do that very thing:
>>
>> http://technet.microsoft.com/en-us/sysinternals/bb897545.aspx
>>
>> > And from that list get the
>> > last logon that they did?
>>
>> As I recall, psloggedon does that as well.
>>
>> /Al
>>
>> >
>> >
>> > "Al Dunbar" wrote:
>> >
>> >>
>> >> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
>> >> news:942C7AE6-29F6-4AF5-8FD7-D4651642D7E0[ at ]microsoft.com...
>> >> > Hi Pegasus you're very helpfull.
>> >> >
>> >> > Although the rlmueller is an excellent site with lots of script
>> >> > solutions,
>> >> > I
>> >> > cannot find anything to my particular scenario!!!
>> >>
>> >> Very often you will never find the exact solution to a problem -
>> >> unless
>> >> someone else has had the exact problem before. Rather, you need to
>> >> understand information such as found on Richard's site, and figure out
>> >> how
>> >> to adapt it to your situation.
>> >>
>> >> > I need to run the script
>> >> > against the servers and take all users info that logged on that
>> >> > server,
>> >> > last
>> >> > time they logged, description, if is a local user or domain user!!!
>> >>
>> >> Whether or not this can be done may depend on whether or not the
>> >> information
>> >> has been logged in the past. You may need to enable some sort of
>> >> auditing
>> >> to
>> >> be able to do this in the future.
>> >>
>> >> Alternately, you could look at the date of the NTUSER.DAT file in each
>> >> profile. I find that in our environment this is not always accurate.
>> >>
>> >> > Do you think that is possible with script?
>> >>
>> >> Yes - but only if the information is there somewhere.
>> >>
>> >> > I already found some samples
>> >> > (WMI) I downloaded the WMI code creator and scriptomatic and I used
>> >> > the
>> >> > Win32_UserAccount, but this doesn't give me the last time that they
>> >> > logged
>> >> > on?
>> >> >
>> >> > I'm starting going crazy with this... :(
>> >> >
>> >> > For example I also nee to get software installed on those servers,
>> >> > again I
>> >> > used scriptomatic to create a script with Win32_Product, guess
>> >> > what??
>> >> > Not
>> >> > all
>> >> > installed software is returned?? Why? I did a test on a server with
>> >> > SQL
>> >> > installed and the SQL wasn't listed??
>> >>
>> >> I would suggest you start a different discussion thread on this other
>> >> unrelated issue, as combining the two issues in one thread is likely
>> >> to
>> >> prove counterproductive.
>> >>
>> >> /Al
>> >>
>> >>
>> >> > Perhaps I'm using the wrong classes I don't know... All I know is
>> >> > that
>> >> > I
>> >> > need the list for all these tasks and I have nothing so far...
>> >> >
>> >> > Thank you for your time.
>> >> >
>> >> > "Pegasus (MVP)" wrote:
>> >> >
>> >> >>
>> >> >> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
>> >> >> news:F0FA7F70-7CC0-4CB6-A243-C06045345E2E[ at ]microsoft.com...
>> >> >> > Hi everyone,
>> >> >> > I have 2 questions I hope that script experts could help me.
>> >> >> >
>> >> >> > 1-
>> >> >> > I've a huge task to complete.
>> >> >> >
>> >> >> > It's my job to get a list among dozens of servers (2000 and 2003)
>> >> >> > a
>> >> >> > list
>> >> >> > of
>> >> >> > the users that logged on those servers (the servers have local
>> >> >> > and
>> >> >> > domain
>> >> >> > users) and related properties especially:
>> >> >> >
>> >> >> > -User Name
>> >> >> > -Description
>> >> >> > -Last time that the user logged on that server (this is very
>> >> >> > important,
>> >> >> > and
>> >> >> > remember that I've local users and domain users that logs on the
>> >> >> > servers,
>> >> >> > I
>> >> >> > only need to know the last time that they logged on that
>> >> >> > particular
>> >> >> > server).
>> >> >> > -State (enabled or disabled)
>> >> >> >
>> >> >> > - I don't have much experience with scripting but I can't find
>> >> >> > nothing
>> >> >> > that
>> >> >> > has this particular needs.
>> >> >> >
>> >> >> > 2-
>> >> >> > I use a batch file with xcopy that copies files and folders
>> >> >> > between
>> >> >> > computers/servers, however when copying "for example" a
>> >> >> > directory,
>> >> >> > with
>> >> >> > always ask me for destination F=File or D=Directory, is there any
>> >> >> > way
>> >> >> > to
>> >> >> > provide the answer automatically
>> >> >> >
>> >> >> > Xcopy \\computer\share\Directory1 \\Computer\share\ (this is a
>> >> >> > directory)
>> >> >> > /S
>> >> >> >
>> >> >> > Thank you all for the help that you can provide.
>> >> >> >
>> >> >>
>> >> >> 1. There is a lot of relevant stuff on Richard Mueller's site:
>> >> >> http://www.rlmueller.net/products.htm
>> >> >> http://www.rlmueller.net/freecode2.htm
>> >> >> http://www.rlmueller.net
>> >> >>
>> >> >> 2. You have a couple of options:
>> >> >> a) Add a trailing backslash:
>> >> >> xcopy /s "Source Folder" "Destination Folder\"
>> >> >> b) Pipe a "D" into the command:
>> >> >> echo D|xcopy /s "Source Folder" "Destination Folder"
>> >> >> Note that xcopy.exe is now deprecated. If fails occasionally on
>> >> >> large
>> >> >> jobs.
>> >> >> Use robocopy instead.
>> >> >>
>> >> >>
>> >> >>
>> >>
>> >>
>> >>
>>
>>
>>


Re: Script Help
"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> 10/23/2008 12:01:58 AM

"Al Dunbar" <AlanDrub[ at ]hotmail.com.nospaam> wrote in message
news:eynxz1VMJHA.468[ at ]TK2MSFTNGP06.phx.gbl...
[Quoted Text]
>
> "Jmnts" <Jmnts[ at ]discussions.microsoft.com> wrote in message
> news:13C03B0D-619B-4298-85DA-18163D83AA2F[ at ]microsoft.com...
>> Thanks for your time in this issue, unfortunately psloggedon doesn't do
>> that,
>> it only shows logged users at the time of the query.
>
> My bad, sorry, I thought it provided the last logon time as well.
>
>> I'm searching and searching this... I can't believe that no one has a
>> script
>> that queries users that logged on the server.
>
> Well, if there were a script that could do such a query, where do you
> suppose it would find that information? I don't know where it can be
> found. I suspect that if this were possible, it might require that some
> specific auditing be turned on for the purpose. I mentioned this in an
> earlier reply, but you have apparently not looked into that.
>
> I have a script that shows who logged on when and on what workstation, and
> I am sure that many others do as well. The script will not work for you,
> however, as it relies on information collected for it by our logon script.
> It is not foolproof, however, it serves my purposes.
>
> Pegasus gave you three links into Richard Meuller's site that you did not
> seem to find useful. Here is one that gives an example of a logon script
> that collects logon information:
>
> http://www.rlmueller.net/Logon5.htm
>
> Given the solution many of us have come up with, perhaps it is just true
> that the information is simply not available from anywhere in the typical
> configuration. I am quite sure that, if it were, someone would have
> published a script that does precisely what you want.
>
> You may eventually have to: "believe that no one has a script that queries
> users that logged on the server". I know I am not lying when I tell you I
> know of no such script.
>
>
> /Al

<snip>

As an aside, I just ran across a reference to a tool called
LockoutStatus.exe:

http://technet.microsoft.com/en-us/library/cc738772.aspx

It's purpose is to display as much information as possible about a locked
out account. You can see the list of items it displays in the above link.
Missing (of course) is any mention of the source of the last logon attempt,
failed or otherwise.

I would suggest to you that, if that information actually *were* available
from somewhere, then this tool would display it - as would some of the
scripts that have been mentioned in this thread.

Whether or not it is possible to enable auditing of this information, by
default, AD does not log the name of the workstations we log in from. What
would be the point? That information is not required by AD or the servers in
order to service subsequent requests from the client.

I suspect further, that this information cannot be audited. If it could be,
then I think someone might have already explained how, whether in this
thread or the many others asking the same question.

I sense your frustration with this. You probably subscribe to the philosophy
that espouses the theory that, if a thing can be imagined, then it must be
possible. I do to; unfortunately, the thing I imagine is that it might be
possible that we are wrong to assume that "if a thing can be imagined, then
it is possible". If the thing I imagine is true, then the theory is
disproved. But if the thing I imagine is false, the theory is also
disproved.


/Al


Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net
Suche nach Orten, Städten, Postleitzahlen, Vorwahlen, Kfz-Kennzeichen