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: accesschk script to include datestamp

HTVi
TV Discussion Newsgroups

accesschk script to include datestamp
"Altria" <urbantec92[ at ]msn.com> 11/13/2008 2:44:10 PM
Hello All,
I would like to automate a daily report of accesschk againsts a file server
but would like to include a datestamp, for example;

accesschk -rws "group" "folder target" > %datestamp%.txt

I would like afterwards to run a diff command (what is the equivalent of
this in windows?) against the files and see if any access permissions have
changed

Any help would be greatly appreciated!

Thanks,
Altria


Re: accesschk script to include datestamp
Tom Lavedas <tglbatch[ at ]cox.net> 11/13/2008 3:26:22 PM
On Nov 13, 9:44 am, "Altria" <urbante...[ at ]msn.com> wrote:
[Quoted Text]
> Hello All,
> I would like to automate a daily report of accesschk againsts a file server
> but would like to include a datestamp, for example;
>
> accesschk -rws "group" "folder target" > %datestamp%.txt
>
> I would like afterwards to run a diff command (what is the equivalent of
> this in windows?) against the files and see if any access permissions have
> changed
>
> Any help would be greatly appreciated!
>
> Thanks,
> Altria

Try something like this to get a datestamp ...

for %%a in (%date%) do set datestamp=%%a
set datestamp=%datestamp:/=%
accesschk -rws "group" "folder target" > %datestamp%.txt

It creates a date stamp in a form of ddmmyyyy in the US or mm-dd-yyyy
elsewere. A more 'sortable' date stamp requires significantly more
code. Handling dates, in general, is locale dependent, which can
complicate explaining how to get one in batch. It's a bit easier in
WinScript, but that seems to be off topic.

The other question about comparing file contents can be done with the
FC (file compare) utility. For example (in XP), ...

fc file1.txt file2.txt > nul
if not errorlevel 1 (
echo Files are identical
) else (
echo Files are different
)

Tom Lavedas
***********
http://there.is.no.more/tglbatch/
Re: accesschk script to include datestamp
"Altria" <urbantec92[ at ]msn.com> 11/13/2008 4:04:11 PM
Tom thanks for your fast reply!
That is exactly what I needed.

For the second question would it be more complicated to have the file
compare utility do a condition process whereby if changes between files are
found it would send an email?
Or would I need something much more involeved to get that kind of
automation?

Thanks again,
Altria
"Tom Lavedas" <tglbatch[ at ]cox.net> wrote in message
news:2f5dbee6-66ca-4493-ae95-b8ef45694b7d[ at ]e38g2000prn.googlegroups.com...
On Nov 13, 9:44 am, "Altria" <urbante...[ at ]msn.com> wrote:
[Quoted Text]
> Hello All,
> I would like to automate a daily report of accesschk againsts a file
> server
> but would like to include a datestamp, for example;
>
> accesschk -rws "group" "folder target" > %datestamp%.txt
>
> I would like afterwards to run a diff command (what is the equivalent of
> this in windows?) against the files and see if any access permissions have
> changed
>
> Any help would be greatly appreciated!
>
> Thanks,
> Altria

Try something like this to get a datestamp ...

for %%a in (%date%) do set datestamp=%%a
set datestamp=%datestamp:/=%
accesschk -rws "group" "folder target" > %datestamp%.txt

It creates a date stamp in a form of ddmmyyyy in the US or mm-dd-yyyy
elsewere. A more 'sortable' date stamp requires significantly more
code. Handling dates, in general, is locale dependent, which can
complicate explaining how to get one in batch. It's a bit easier in
WinScript, but that seems to be off topic.

The other question about comparing file contents can be done with the
FC (file compare) utility. For example (in XP), ...

fc file1.txt file2.txt > nul
if not errorlevel 1 (
echo Files are identical
) else (
echo Files are different
)

Tom Lavedas
***********
http://there.is.no.more/tglbatch/


Re: accesschk script to include datestamp
"Pegasus \(MVP\)" <I.can[ at ]fly.com.oz> 11/13/2008 6:08:31 PM
Building on Tom's code:
fc file1.txt file2.txt > nul
if not errorlevel 1 (
echo Files are identical
) else (
blat /.. /..
)

blat.exe is a Command Line mailer that you can download from a number of
sites. You could also use a VB Script mailer but since you're running a
batch file there seems to be little point in moving to a hybrid solution.


"Altria" <urbantec92[ at ]msn.com> wrote in message
news:%23Gx94laRJHA.1164[ at ]TK2MSFTNGP03.phx.gbl...
[Quoted Text]
> Tom thanks for your fast reply!
> That is exactly what I needed.
>
> For the second question would it be more complicated to have the file
> compare utility do a condition process whereby if changes between files
> are found it would send an email?
> Or would I need something much more involeved to get that kind of
> automation?
>
> Thanks again,
> Altria
> "Tom Lavedas" <tglbatch[ at ]cox.net> wrote in message
> news:2f5dbee6-66ca-4493-ae95-b8ef45694b7d[ at ]e38g2000prn.googlegroups.com...
> On Nov 13, 9:44 am, "Altria" <urbante...[ at ]msn.com> wrote:
>> Hello All,
>> I would like to automate a daily report of accesschk againsts a file
>> server
>> but would like to include a datestamp, for example;
>>
>> accesschk -rws "group" "folder target" > %datestamp%.txt
>>
>> I would like afterwards to run a diff command (what is the equivalent of
>> this in windows?) against the files and see if any access permissions
>> have
>> changed
>>
>> Any help would be greatly appreciated!
>>
>> Thanks,
>> Altria
>
> Try something like this to get a datestamp ...
>
> for %%a in (%date%) do set datestamp=%%a
> set datestamp=%datestamp:/=%
> accesschk -rws "group" "folder target" > %datestamp%.txt
>
> It creates a date stamp in a form of ddmmyyyy in the US or mm-dd-yyyy
> elsewere. A more 'sortable' date stamp requires significantly more
> code. Handling dates, in general, is locale dependent, which can
> complicate explaining how to get one in batch. It's a bit easier in
> WinScript, but that seems to be off topic.
>
> The other question about comparing file contents can be done with the
> FC (file compare) utility. For example (in XP), ...
>
> fc file1.txt file2.txt > nul
> if not errorlevel 1 (
> echo Files are identical
> ) else (
> echo Files are different
> )
>
> Tom Lavedas
> ***********
> http://there.is.no.more/tglbatch/
>


Re: accesschk script to include datestamp
"Altria" <urbantec92[ at ]msn.com> 11/13/2008 9:50:42 PM
Thank you Pegasus!
Actually another question then would be do you think that the accesschk is
the best way of capturing and automating this information. Is there a better
way and simpler way via vbscript, perl,python etc.?

Thanks again,
Altria
"Pegasus (MVP)" <I.can[ at ]fly.com.oz> wrote in message
news:e5HcXrbRJHA.4504[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> Building on Tom's code:
> fc file1.txt file2.txt > nul
> if not errorlevel 1 (
> echo Files are identical
> ) else (
> blat /.. /..
> )
>
> blat.exe is a Command Line mailer that you can download from a number of
> sites. You could also use a VB Script mailer but since you're running a
> batch file there seems to be little point in moving to a hybrid solution.
>
>
> "Altria" <urbantec92[ at ]msn.com> wrote in message
> news:%23Gx94laRJHA.1164[ at ]TK2MSFTNGP03.phx.gbl...
>> Tom thanks for your fast reply!
>> That is exactly what I needed.
>>
>> For the second question would it be more complicated to have the file
>> compare utility do a condition process whereby if changes between files
>> are found it would send an email?
>> Or would I need something much more involeved to get that kind of
>> automation?
>>
>> Thanks again,
>> Altria
>> "Tom Lavedas" <tglbatch[ at ]cox.net> wrote in message
>> news:2f5dbee6-66ca-4493-ae95-b8ef45694b7d[ at ]e38g2000prn.googlegroups.com...
>> On Nov 13, 9:44 am, "Altria" <urbante...[ at ]msn.com> wrote:
>>> Hello All,
>>> I would like to automate a daily report of accesschk againsts a file
>>> server
>>> but would like to include a datestamp, for example;
>>>
>>> accesschk -rws "group" "folder target" > %datestamp%.txt
>>>
>>> I would like afterwards to run a diff command (what is the equivalent of
>>> this in windows?) against the files and see if any access permissions
>>> have
>>> changed
>>>
>>> Any help would be greatly appreciated!
>>>
>>> Thanks,
>>> Altria
>>
>> Try something like this to get a datestamp ...
>>
>> for %%a in (%date%) do set datestamp=%%a
>> set datestamp=%datestamp:/=%
>> accesschk -rws "group" "folder target" > %datestamp%.txt
>>
>> It creates a date stamp in a form of ddmmyyyy in the US or mm-dd-yyyy
>> elsewere. A more 'sortable' date stamp requires significantly more
>> code. Handling dates, in general, is locale dependent, which can
>> complicate explaining how to get one in batch. It's a bit easier in
>> WinScript, but that seems to be off topic.
>>
>> The other question about comparing file contents can be done with the
>> FC (file compare) utility. For example (in XP), ...
>>
>> fc file1.txt file2.txt > nul
>> if not errorlevel 1 (
>> echo Files are identical
>> ) else (
>> echo Files are different
>> )
>>
>> Tom Lavedas
>> ***********
>> http://there.is.no.more/tglbatch/
>>
>
>


Re: accesschk script to include datestamp
"Pegasus \(MVP\)" <I.can[ at ]fly.com.oz> 11/13/2008 11:19:48 PM
Sorry, I know nothing about accesschk and what it does.


"Altria" <urbantec92[ at ]msn.com> wrote in message
news:elOQhndRJHA.1148[ at ]TK2MSFTNGP05.phx.gbl...
[Quoted Text]
> Thank you Pegasus!
> Actually another question then would be do you think that the accesschk is
> the best way of capturing and automating this information. Is there a
> better way and simpler way via vbscript, perl,python etc.?
>
> Thanks again,
> Altria
> "Pegasus (MVP)" <I.can[ at ]fly.com.oz> wrote in message
> news:e5HcXrbRJHA.4504[ at ]TK2MSFTNGP02.phx.gbl...
>> Building on Tom's code:
>> fc file1.txt file2.txt > nul
>> if not errorlevel 1 (
>> echo Files are identical
>> ) else (
>> blat /.. /..
>> )
>>
>> blat.exe is a Command Line mailer that you can download from a number of
>> sites. You could also use a VB Script mailer but since you're running a
>> batch file there seems to be little point in moving to a hybrid solution.
>>
>>
>> "Altria" <urbantec92[ at ]msn.com> wrote in message
>> news:%23Gx94laRJHA.1164[ at ]TK2MSFTNGP03.phx.gbl...
>>> Tom thanks for your fast reply!
>>> That is exactly what I needed.
>>>
>>> For the second question would it be more complicated to have the file
>>> compare utility do a condition process whereby if changes between files
>>> are found it would send an email?
>>> Or would I need something much more involeved to get that kind of
>>> automation?
>>>
>>> Thanks again,
>>> Altria
>>> "Tom Lavedas" <tglbatch[ at ]cox.net> wrote in message
>>> news:2f5dbee6-66ca-4493-ae95-b8ef45694b7d[ at ]e38g2000prn.googlegroups.com...
>>> On Nov 13, 9:44 am, "Altria" <urbante...[ at ]msn.com> wrote:
>>>> Hello All,
>>>> I would like to automate a daily report of accesschk againsts a file
>>>> server
>>>> but would like to include a datestamp, for example;
>>>>
>>>> accesschk -rws "group" "folder target" > %datestamp%.txt
>>>>
>>>> I would like afterwards to run a diff command (what is the equivalent
>>>> of
>>>> this in windows?) against the files and see if any access permissions
>>>> have
>>>> changed
>>>>
>>>> Any help would be greatly appreciated!
>>>>
>>>> Thanks,
>>>> Altria
>>>
>>> Try something like this to get a datestamp ...
>>>
>>> for %%a in (%date%) do set datestamp=%%a
>>> set datestamp=%datestamp:/=%
>>> accesschk -rws "group" "folder target" > %datestamp%.txt
>>>
>>> It creates a date stamp in a form of ddmmyyyy in the US or mm-dd-yyyy
>>> elsewere. A more 'sortable' date stamp requires significantly more
>>> code. Handling dates, in general, is locale dependent, which can
>>> complicate explaining how to get one in batch. It's a bit easier in
>>> WinScript, but that seems to be off topic.
>>>
>>> The other question about comparing file contents can be done with the
>>> FC (file compare) utility. For example (in XP), ...
>>>
>>> fc file1.txt file2.txt > nul
>>> if not errorlevel 1 (
>>> echo Files are identical
>>> ) else (
>>> echo Files are different
>>> )
>>>
>>> Tom Lavedas
>>> ***********
>>> http://there.is.no.more/tglbatch/
>>>
>>
>>
>
>


Re: accesschk script to include datestamp
"Altria" <urbantec92[ at ]msn.com> 11/17/2008 3:05:59 PM
Accesschk is by sysinternals (MS) and allows you to enumerate access
permissions of a group or user to a folder or files on the system. It is
command-line based and is similar to the GUI equivalent which accessenum

The problem with these utilities is that they are very general. What if I
wanted a specific user or more than one but not a group, I am unable to do
this. That is why I was curious to know if there was a "preferred" method of
obtaining and tracking access rights to shares?

Thanks,
Altria
"Pegasus (MVP)" <I.can[ at ]fly.com.oz> wrote in message
news:eD8bTZeRJHA.3932[ at ]TK2MSFTNGP02.phx.gbl...
[Quoted Text]
> Sorry, I know nothing about accesschk and what it does.
>
>
> "Altria" <urbantec92[ at ]msn.com> wrote in message
> news:elOQhndRJHA.1148[ at ]TK2MSFTNGP05.phx.gbl...
>> Thank you Pegasus!
>> Actually another question then would be do you think that the accesschk
>> is the best way of capturing and automating this information. Is there a
>> better way and simpler way via vbscript, perl,python etc.?
>>
>> Thanks again,
>> Altria
>> "Pegasus (MVP)" <I.can[ at ]fly.com.oz> wrote in message
>> news:e5HcXrbRJHA.4504[ at ]TK2MSFTNGP02.phx.gbl...
>>> Building on Tom's code:
>>> fc file1.txt file2.txt > nul
>>> if not errorlevel 1 (
>>> echo Files are identical
>>> ) else (
>>> blat /.. /..
>>> )
>>>
>>> blat.exe is a Command Line mailer that you can download from a number of
>>> sites. You could also use a VB Script mailer but since you're running a
>>> batch file there seems to be little point in moving to a hybrid
>>> solution.
>>>
>>>
>>> "Altria" <urbantec92[ at ]msn.com> wrote in message
>>> news:%23Gx94laRJHA.1164[ at ]TK2MSFTNGP03.phx.gbl...
>>>> Tom thanks for your fast reply!
>>>> That is exactly what I needed.
>>>>
>>>> For the second question would it be more complicated to have the file
>>>> compare utility do a condition process whereby if changes between files
>>>> are found it would send an email?
>>>> Or would I need something much more involeved to get that kind of
>>>> automation?
>>>>
>>>> Thanks again,
>>>> Altria
>>>> "Tom Lavedas" <tglbatch[ at ]cox.net> wrote in message
>>>> news:2f5dbee6-66ca-4493-ae95-b8ef45694b7d[ at ]e38g2000prn.googlegroups.com...
>>>> On Nov 13, 9:44 am, "Altria" <urbante...[ at ]msn.com> wrote:
>>>>> Hello All,
>>>>> I would like to automate a daily report of accesschk againsts a file
>>>>> server
>>>>> but would like to include a datestamp, for example;
>>>>>
>>>>> accesschk -rws "group" "folder target" > %datestamp%.txt
>>>>>
>>>>> I would like afterwards to run a diff command (what is the equivalent
>>>>> of
>>>>> this in windows?) against the files and see if any access permissions
>>>>> have
>>>>> changed
>>>>>
>>>>> Any help would be greatly appreciated!
>>>>>
>>>>> Thanks,
>>>>> Altria
>>>>
>>>> Try something like this to get a datestamp ...
>>>>
>>>> for %%a in (%date%) do set datestamp=%%a
>>>> set datestamp=%datestamp:/=%
>>>> accesschk -rws "group" "folder target" > %datestamp%.txt
>>>>
>>>> It creates a date stamp in a form of ddmmyyyy in the US or mm-dd-yyyy
>>>> elsewere. A more 'sortable' date stamp requires significantly more
>>>> code. Handling dates, in general, is locale dependent, which can
>>>> complicate explaining how to get one in batch. It's a bit easier in
>>>> WinScript, but that seems to be off topic.
>>>>
>>>> The other question about comparing file contents can be done with the
>>>> FC (file compare) utility. For example (in XP), ...
>>>>
>>>> fc file1.txt file2.txt > nul
>>>> if not errorlevel 1 (
>>>> echo Files are identical
>>>> ) else (
>>>> echo Files are different
>>>> )
>>>>
>>>> Tom Lavedas
>>>> ***********
>>>> http://there.is.no.more/tglbatch/
>>>>
>>>
>>>
>>
>>
>
>


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