Windows Server - accesschk script to include datestamp

Asked By Altria
13-Nov-08 09:44 AM
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
VB
(1)
XP
(1)
Report
(1)
WinScript
(1)
Vbscript
(1)
B8ef45694b7d
(1)
Sysinternals
(1)
Accessenum
(1)
  Tom Lavedas replied...
13-Nov-08 11:35 PM
er
e

Try something like this to get a datestamp ...

for %%a in (%date%) do set datestamp=3D%%a
set datestamp=3D%datestamp:/=3D%
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/
  Altria replied...
13-Nov-08 11:04 AM
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

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/
  Pegasus \(MVP\) replied...
13-Nov-08 01:08 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 replied...
13-Nov-08 04:50 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\) replied...
13-Nov-08 06:19 PM
Sorry, I know nothing about accesschk and what it does.
  Altria replied...
17-Nov-08 10:05 AM
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
Create New Account
help
that match either scheduled (6:00) or on demand reports. Windows SBS2008 console shows reports report in archieve. Where next? Windows Server SBS Discussions SQL Server (1) Windows Server Update (1 reports stopped yesterday. It seemed email was going out but recipient didn't get the report. Moreover, task scheduler shows failed SessionAgent and Systemdataproviders. If I have misunderstood your concerns please know. Before we moving on, I would like to know that: 1. Besides the daily report email issue, does normal internal / external Exchange mail flow work fine? 2. Have you tried with other users as the report email recipient? Does that work? 3. Does the "Generate and E-mail report" option works if you manually click it to send a report email by force? Based on the current situation, we first need to narrow down whether the scheduled daily report emails is generated or not. If it is generated but user cannot receive it, it should be an Exchange server transport issue. Otherwise, if the report is not generated, we need to first focus on the SBS monitoring and reporting service
no access to nearby PC (XP) ??? Windows Server I have a 3 PC network, using AT&T's 2-wire 1701HG wired modem. I have it connected to an XP system, a win2k system, and an older win98se system. I have made all the drives on all three PC's "shared" with no restrictions, and the XP PC can see all the drives on the other two PC's (the win2k and need for my win2k PC to have access to the h / d's on my XP system, and, when I try to "explore" the XP machine from within my Win2k "My network" dialogue, it says I do not have access go about getting my win2k system configured so that it can gain access to my XP's hard drives? From my win2k PC, I have full access to all the drives any of my 3 PC's, so, I cannot understand why I cannot "explore" my XP machine from my win2k PC - I need to be able to do that so I first I have to get past that message denying me to even peek at my XP system from my win2k system. Also, how do I find out (from within my win2k
be included in statistics for PC's needing updates? For example, we have SP3 for XP. We're definitely making plans to install it but aren't ready to yet. But it sits in my list as needed and all the PC's report in as missing that update. What I'd prefer is that the status show 100% the Declined list and then approve them? Thank you. Windows Server Update Services Discussions Windows XP (1) Active Directory (1) Windows 7 (1) Vista (1) ISDN (1) XP (1) Lawrence.Garvin (1) WSUSdom (1) Yep. Its even worse if you want the approve t. They are. By default. This is a specific flaw in the detection package for XP SP3, and is well documented, has been complained about ad naseum, and the Microsoft teams the update is no longer visible to the WSUS clients, and thus those clients cannot report status (nor will the WSUS Server display status) on whether the update is Needed, Not ready to deploy it and it bothers me that all the PC's will never report green status with these types of updates left out there as "not approved". If I truly want the PC's to report green status, it seems, at least as WSUS works today, my only option is to
other through a Wireless-N Gigabit Router (model number WRT310N). One PC is running Windws XP while the other is running Windows 7. At this point I do not have, or would, however, like to call web pages on the Windows 7 PC from the Windows XP PC. The Windows 7 PC has php files that run C++ files to analyze files supplied by the Windows XP PC and I would like to send the results of the analysis back to the XP PC. The reason for this is that I am setting up a home based web I want to keep hackers from accessing files on my Windows 7 PC. So the XP will be connected directly to the Internet and the Windows 7 PC will only be connected to the XP PC. I can successfully ping both ways between the Windows 7 PC and XP PC. So I fire up FireFox (FF) on the XP PC and type the following in the FF URL box. [Win7PCIPAddress] / SharedDirectoryOnWin7PC / FileName.hmtl The
if this makes any difference. Meantime anyone any ideas ? Jim. Windows Server SBS Discussions Windows XP (1) Windows Server 2008 (1) Windows Server 2003 (1) Microsoft Exchange (1) Windows Update (1 the users have Outlook 2003. . Jim. Hi Cliff, All the client PC's are Windows XP SP3 and Office 2003 SP3 The only thing changed on the client PC's was works fine from there as well. Only seems to be an issue with the Windows XP PC's Would Windows Server 2008 and Windows 7 have Search Indexing as part of signing on the SBS 2008 and doing a restart. I do not think that the XP PC's have Windows Search installed. . .perhaps I should do this then ? is this not Windows 2008 Terminal Server desktops OK and a Windows 7 machine. So it seems Windows XP Pro related ? There is not any Window Search indexer installed on the XP machines, I will give that a go next. BTW all the Autotuning network features are answer your previous question, Vista, 7 & 2008 have the Windows = Desktop Search installed by default. XP would need it installed. It = should have come across with a Windows Update unless you it has not made any difference. Another thing done at the same time on the XP PC's was the addition of add in Gigabit network cards. Guess it could be