Programming and Scripting Archive

  • How To Backup a Database Using SQL Server Management Studio

    How To Backup a Database Using SQL Server Management Studio

    Tweet To backup your databases, you can use the ‘SQL Server Management Studio’ GUI or T-SQL query to accomplish the job. Both are easy to use.  Below are the steps on how to do it. Backing up databases by GUI: 1.) Launch the “SQL Server...

    Full Story

  • drupal

    PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062

    Tweet Today, we came across a problem with Drupal.  Every time when we tries to add new contents, it is giving us the following error message PDOException: SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry ’0′ for key 2 INSERT INTO {node}… At first, we thought...

    Full Story

  • Syntax error or access violation: 1226 User ‘username’ has exceeded the ‘max_questions’ resource (current value: 75000)

    Syntax error or access violation: 1226 User ‘username’ has exceeded the ‘max_questions’ resource (current value: 75000)

    Tweet Recently, one of our CMS site receives the following error message: Syntax error or access violation: 1226 User ‘username’ has exceeded the ‘max_questions’ resource (current value: 75000) This is clearly an issue with our hosting company.  They have setup a MAX limits on the...

    Full Story

  • windows

    How to list mapped drives on remote computers?

    Tweet Wondering how to list all the mapped drives of remote users? There are two way I can think of that can do this. 1. Is to write a script that loop through the registry keys on the user’s profile for mapped drives. 2. Is...

    Full Story

  • dsquery piped to dsmove doesn’t work

    dsquery piped to dsmove doesn’t work

    Tweet Recently, we have to do some cleanup on our company’s Active Directory.  So we written some dsquery and dsmove scripts to do this and adding it to our daily, weekly, and monthly scheduled tasks.  All of our dsquery, dsmove, dsadd, dsget, dsrm are ran...

    Full Story

  • How to delete TCP IP printers?

    How to delete TCP IP printers?

    Tweet So you want to know how to create a script to delete a TCP/IP printer from a computer?  You are in luck.  There are several ways to do this, but the easiest way to accomplish this is by using the ‘WMIC’ command.  Once you...

    Full Story

  • Assign Printers Based on Group Membership

    Assign Printers Based on Group Membership

    Tweet Today, I was giving the task of assigning printers to a set of users based on their group membership.  By searching online, I found this script from the Microsoft site which does exactly what I am tasked to do. Link Tweet

    Full Story

  • How to rename mapped shares remotely?

    How to rename mapped shares remotely?

    Tweet Today, I came across a task of renaming all of our users personal folders to another server, and we have 1000 users.  This will be a pain in the butt if I have to go to every station to manually remap the new share...

    Full Story

  • Linux: How to search and print command output?

    Linux: How to search and print command output?

    Tweet Well today, I was trying to do a simple test with Ubuntu. .. that is trying to print the output of the ‘ps -aux‘ command.  It wasn’t that bad.  The way to do this is to pipe it into the ‘LPR’ that is your...

    Full Story

  • How to display password expiry date for all users in Active Directory

    How to display password expiry date for all users in Active Directory

    Tweet Here is a script that I found on the web that will list out all users with password expiry date and will email the user with instruction on how to change their password. Option Explicit Dim objCommand, objConnection, strBase Dim strFilter, strAttributes, strPasswordChangeDate, intPassAge...

    Full Story