Posted on March 23, 2016 by Michael Thompson
Type about:config in the address bar.
Make sure both of these settings are true.
network.automatic-ntlm-auth.allow-non-fqdn
network.negotiate-auth.allow-non-fqdn
Screenshot of Firefox about:config
Filed under: Active Directory, Firefox | Tagged: ad, Firefox, proxy | Leave a comment »
Posted on December 21, 2015 by Michael Thompson
This HTA file will allow end users to compile basic system information and supply that to help desk staff. Copy/Paste the code below to Notepad and name the file with a HTA extension.
<html>
<head>
<title>Help and Support</title>
<HTA:APPLICATION
APPLICATIONNAME="Help and Support"
ID="HelpandSupport"
VERSION="1.0"
BORDER="dialog"
INNERBORDER="no"
MAXIMIZEBUTTON="no"
MINIMIZEBUTTON="no"
ICON="Help.ico"
SCROLL="no"/>
</head>
Sub Window_OnLoad
Dim width,height
width=300
height=500
self.ResizeTo width,height
self.MoveTo (screen.AvailWidth-width)/2,(screen.AvailHeight-height)/2
End Sub
Sub OnClickButtonCancel()
window.Close
End Sub
<body bgcolor=#fffff;>
<table border=0 width=100% height=100%>
<tr>
<td height=100% width=100% valign=top align=left>
<!--Add your controls here-->
function computername()
{
var wshShell = new ActiveXObject("WScript.Shell");
var computername = wshShell.ExpandEnvironmentStrings("%COMPUTERNAME%");
return computername
}
function username()
{
var wshshell=new ActiveXObject("wscript.shell");
var username=wshshell.ExpandEnvironmentStrings("%username%");
return username
}
function ipAddress() {
var ipAddress = "";
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}");
e = new Enumerator(wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"));
for(; !e.atEnd(); e.moveNext()) {
var s = e.item();
ipAddress = s.IPAddress(0);
}
return ipAddress
}
function macAddress() {
var macAddress = "";
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}");
e = new Enumerator(wmi.ExecQuery("SELECT * FROM Win32_NetworkAdapterConfiguration WHERE IPEnabled = True"));
for(; !e.atEnd(); e.moveNext()) {
var s = e.item();
macAddress = s.MACAddress;
}
return macAddress
}
/*
Here's how to get MotherBoard Serial Number.
function serialNumber() {
var serialNumber = "";
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}");
e = new Enumerator(wmi.ExecQuery("SELECT * FROM Win32_BaseBoard"));
for(; !e.atEnd(); e.moveNext()) {
var s = e.item();
serialNumber = s.SerialNumber;
}
return serialNumber
} */
/* Here's how to get computer Serial Number
This is the javascript version of cmd = wmic bios get serial number
*/
function serialNumber() {
var serialNumber = "";
var wmi = GetObject("winmgmts:{impersonationLevel=impersonate}");
e = new Enumerator(wmi.ExecQuery("SELECT * FROM Win32_BIOS"));
for(; !e.atEnd(); e.moveNext()) {
var s = e.item();
serialNumber = s.SerialNumber;
}
return serialNumber
}
/* Global variables */
var cname = computername();
var uname = username();
var ip = ipAddress();
var mac = macAddress();
var serial = serialNumber();
/* function Send() {
var email = 'someemail@company.com';
var subject = uname + ' computer information';
var body = 'Computer Information \n' + 'User Name: ' + uname +'\n' +
'Computer Name: ' + cname +'\n'+ 'IP address: ' + ip + '\n' +
'MAC address: ' + mac + '\n' + 'PC Serial#: ' + serial + '\n\n' +
'Phone Number?: ' + '\n\n' +
'Problem Description?: ';
location.href = 'mailto:' + email
+ '?subject=' + encodeURIComponent(subject)
+ '&body=' + encodeURIComponent(body);
} */
function ClipBoard() {
holdtext.innerText = 'Computer Information \n' + 'User Name: ' + uname +'\n' +
'Computer Name: ' + cname +'\n'+ 'IP address: ' + ip + '\n' +
'MAC address: ' + mac + '\n' + 'PC Serial#: ' + serial + '\n\n' +
'Phone Number?: ' + '\n\n' +
'Problem Description?: ';
Copied = holdtext.createTextRange();
Copied.execCommand("Copy");
}
<p style="margin-top: 0; margin-bottom: 0"> </p>
<strong>User Name: </strong> document.write(uname);<br>
<strong>Computer Name: </strong> document.write(cname);<br />
<strong>IP address: </strong> document.write(ip);<br />
<strong>MAC address: </strong> document.write(mac);<br />
<strong>PC Serial#: </strong> document.write(serial);
<textarea id="holdtext" style=display:none;"></textarea>
<p style="margin-top: 0; margin-bottom: 0"> </p>
*Please provide the above information when you contact the Help Desk for any computer or software issues.
<hr>
<center>
Help Desk #: (555) 555-1234<br>
</center>
</td>
</tr>
<tr>
<td align=right>
<input type="button" style="width: 80px" name="Close" id="Cancel" value="Close" onclick="OnClickButtonCancel">
<input type="button" onClick="ClipBoard()" value="Copy to Clipboard">
<!-- <input type="button" style="width: 80px" name="Send" id="Send" value="Send" onclick="Send()"> -->
</td>
</tr>
</table>
</body>
</html>
Note: I cannot take full credit for this. I have copied and pasted this code from other resources over the years. I’m just posting what I use up for for later reference.
Filed under: Microsoft, Windows, Windows 7 | Tagged: desk, help, hta, pcinfo, support | Leave a comment »
Posted on June 29, 2015 by Michael Thompson
Two separate files:
SQLBackupScript.sql
/* SQLBackupScript.sql */
DECLARE @name VARCHAR(50) — database name
DECLARE @path VARCHAR(256) — path for backup files
DECLARE @fileName VARCHAR(256) — filename for backup
DECLARE @fileDate VARCHAR(20) — used for file name
SET @path = ‘C:\is\backups\sql\’
SELECT @fileDate = CONVERT(VARCHAR(20),GETDATE(),112)
DECLARE db_cursor CURSOR FOR
SELECT name
FROM master.dbo.sysdatabases
WHERE name NOT IN (‘tempdb’)
OPEN db_cursor
FETCH NEXT FROM db_cursor INTO @name
WHILE @@FETCH_STATUS = 0
BEGIN
SET @fileName = @path + @name + ‘_’ + @fileDate + ‘.BAK’
BACKUP DATABASE @name TO DISK = @fileName
FETCH NEXT FROM db_cursor INTO @name
END
CLOSE db_cursor
DEALLOCATE db_cursor
/*
SQLBackup.bat
::del “C:\is\backups\sql\*.*” /q
forfiles /p “C:\is\backups\sql\” /s /m *.* /c “cmd /c Del @path” /d -5
“D:\Program Files\Microsoft SQL Server\100\Tools\Binn\SQLCMD.EXE” -Slocalhost\<INSTANCENAME> -Usa -P<PASSWORD> -i”C:\is\scripts\SQLBackupScript.sql”
Filed under: Command Line, Microsoft, SQL Server | Tagged: sql | Leave a comment »
Posted on May 11, 2015 by Michael Thompson
I have seen a number of new Windows 8.1 Surface tablets come up with a “Limited Connectivity” error when connected to a good wireless network. Resetting the network and pinging Google usually brings the network back to working condition, but the error usually reappears.
I have tried to reinstall network drivers, including rolling back to previous versions. Some users have reported that this resolved the issue, but it never did for me, so I continued my research.
Upon my research, I stumpled upon a Microsoft’s Answer’s post titled wifi issues from November 2012. I tested the solution and it seemed to work perfectly on all my Surface systems.
In a nutshell, here is the solution:
Open the Command Prompted (as Administrator)
Type the following commands:
netsh int tcp set heuristics disabled
netsh int tcp set global autotuninglevel=disabled
netsh int tcp set global rss=enabled
After these commands have been entered, reboot.
Filed under: Surface, Windows 8, Wireless | Tagged: Limited Connectivity | Leave a comment »
Posted on January 22, 2012 by Michael Thompson
Posted on August 4, 2011 by Michael Thompson
If you ever needed to test the throughput or bandwidth of your LAN or WAN, here is a small utility that will allow you to truly see what the network speed is working at.
Prerequisite: PsTools, specifically PsExec must be available on your computer. Dropping all the “Ps” tools into your %PATH% is recommended.
- Download TTCP from http://www.pcausa.com/Utilities/pcattcp/PCATTCP-0114.zip
- Extract PCATTCP.exe and save to your local drive (e.g. c:\is)
- Open a Command Prompt, cd to your working path (e.g. cd\is)
- Remotely executethe TTCP utility in receive mode on the remote PC
psexec \\192.168.0.14 -c -d -s -v -w c:\ PCATTCP.exe –r
- If you need to kill the process, issue the pskill \\192.168.0.14 ProcessID command (e.g. pskill \\192.168.0.14 2268)
- Switch definition: copy program (-c), don’t wait for process (-d), run as System Account (-s), copy program if newer (-v), set remote working directory (-w), receive (-r)
- Open another Command Prompt windows, cd to your working directory
- Executethe TTCP utility in transmit mode on the local PC
- PCATTCP.exe -t -f m 192.168.0.14
- Depending on the connection, it may take a few moments
- Switch definition: transmit (-t), format in megabits (-f m)
- The process automatically kills itself once the test is complete
Filed under: Command Line, Network, Windows | Tagged: bandwidth, lan, Network, pcattcp, performance, throughput, ttcp | Leave a comment »
Posted on July 22, 2011 by Michael Thompson
Quick and easy way to delete your Event Viewer Logs in Windows 7.
@echo off
for /F "tokens=*" %%G in ('wevtutil.exe el') DO (call :clear_it "%%G")
echo.
echo Event Logs have been cleared! ^<press any key^>
goto fin
:clear_it
echo %1 - CLEARED
wevtutil.exe cl %1
goto :eof
:fin
pause>NUL
Note: You must run this at the elevated command prompt
Many thanks to http://www.sevenforums.com where I found this code.
Filed under: Command Line, Microsoft, Windows 7 | Tagged: clear, event viewer, logs | 1 Comment »
Posted on July 22, 2011 by Michael Thompson
Pretty simple method on extracting users distinguished name (dn) data from Active Directory.
dsquery.exe * -limit 0 -filter "(&(objectCategory=Person)(objectClass=User)(!userAccountControl:1.2.840.113556.1.4.803:=2))" >"c:\activeUsers.txt"
Note: This will only extract active users. To gather a list of all users, simply run:
dsquery user
Filed under: Active Directory, Microsoft | Tagged: Active Directory, ad, distinguished, dn, name, users | Leave a comment »
Posted on July 22, 2011 by Michael Thompson
This PowerShell script allows you to update or append user objects in Active Directory based on data in an external data file (csv).
$users = import-csv c:\is\scripts\ps1\ourusers.csv
foreach($row in $users)
{
$dn = $row.dn
$user=[ADSI]"LDAP://$dn"
$telephoneNumber = $row.telephoneNumber
$user.put("telephoneNumber", $telephoneNumber)
$user.SetInfo()
}
The data file needs to have the following format:
dn,telephoneNumber
“distinguished name”,telephoneNumber
Reference: Quickly query Active Directory to find users distinguished name
Filed under: Active Directory, Microsoft, PowerShell | Tagged: Active Directory, ad, powershell, script, update, users | Leave a comment »
Posted on July 21, 2011 by Michael Thompson
Quick tip on how to reduce your Winsxs folder on your Windows 7 drive after you have installed SP1.
Open an elevated Command Prompt and type the following command:
DISM /online /Cleanup-Image /SpSuperseded
I have seen varying reports on how much this will reduce your WinSXS folder, but I’ve seen reports for as much as 6 GB and as little as 1.2 GB. In my case, I recovered about 1.8 GB.
Important note: You will not be able to uninstall SP1 after this procedure completes.
Filed under: File System, Microsoft, Server, Windows, Windows 7 | Tagged: sp1, vista, windows, windows 7, winsxs | Leave a comment »