Batch file set year into the future
Simple batch to set a variable 2 years into the future, works out Year, plus 2 and then adds to the date Credits: SS64 set /a YEARVAR=%DATE:~+8,2% set /a YEARVAR=%YEARVAR%+2 set YEARVAR=%YEARVAR% set DATEVAR=%DATE:~0,8% set “EXP_DATE=%DATEVAR%%YEARVAR%”
Restart Windows Server Task Scheduler
Requires PSExec to use the interactive account psexec -i -s cmd sc stop schedule sc start schedule Credits: StackOverflow
V1 DBAuthorise grab a list of Purchase Orders
V1 DBAuthorise can be setup to have multiple Purchase orders, so I use a Common Table Expression in a view for any time I need to get a list of Purchase Orders and Sage Company that is not in ~Accepted and State OK (1024). user5 for us is the PO number and user7 the Sage…
Simple method to see what AD Users SQL Server can see in AD Groups
Credit: Microsoft StackOverflow user Saranya Kumaran Simple method to see what AD Users SQL Server can see in AD Groups exec xp_logininfo ‘Domain/AD Group’, ‘all’ exec xp_logininfo ‘Domain/AD Group’, ‘members’ Notes: Non ad group first command returns error, second command returns no output Msg 15404, Level 16, State 10, Procedure xp_logininfo, Line 64 [Batch Start…
Powershell script to manage V1 dbadeposit issues in pull config
Credits: Superuser Microsoft Docs V1 dbadeposit can exit and stop working when in a pull configuration (Normally V1 dbadeposit is setup in a push to configuration) if a tag file (Metadata) is not produced along with the arq file and binary blob file. If you check and find you are actually missing no scans like…
Maximum History Reached in Code & Post Registered Invoices
Credit: Datel Code & Post Registered Invoices has a database limit on the plreghstm table and can hold 79 rows before displaying the error Maximum History Reached (Even though the field supports 4 characters). The last row holds a ~ (Tilda) in the page number field causing the error message and subsequently the automation routine…
Prevent Duplicate Audit Entry warnings on Sage Line 500 when migrating systems
The file .seqno in csmaster/master is used to maintain the current audit reference. Ensure its copied from the old server otherwise it will start from zero causing duplicates and failure to post audit entries to the database. System Keys which track the Sequence Number: CEAUSEQNO Errors: Auditing failed: xx_xxxx_xxx event C. Duplicate seq. no.nnnn?
Microsoft Message Queuing Service – Correct Permission Issue
Credit: Aggregated Intelligence We had a request after software was installed to give permissions to a group in Windows AD. This was failing because the only account with access was the SYSTEM account When making any changes it would fail with 2 errors On the permission screen click Advanced, change the location to the local…
Sage Line 500 password policy implementation and force password reset
I wrote a simple script to aid users moving to a new password policy, users were put on a policy which would expire a password after a day. Once they had changed their password the policy is amended to the new policy. I now use this for forcing password resets. Replace and with your Sage…
Test Pop3
Pop3 can be tested via Command line using the telnet executable (Will need to be selected from Windows features). Telnet to the Pop3 server in question, this will test Pop3 is accessible, then enter the username and password. As long as the status is OK then it should work. If not the error should provide…