Wife slipped on the stairs fracturing her big toe in such away she has to wear a cast for 4 weeks…
This is going to be a short post, I fractured at least one bone in my hand playing basketball the other night, after sitting 6 hours in the emergency room until 4.30 in the morning, they decided that since at least one bone was fractured both vertically and horisontally I would need a cast. So the next 3 weeks it is back to the one handed 4 finger system. *sigh*
I just got my new TomTom 930T GPS, I unpacked it and connected it to my phone via Bluetooth, it asked me if I wanted to connect to “internet” and of course I had to try it, it asked me which country I was in, then which phone I had, my Nokia E65 was in the list, then which telco I used… But to my luck mine was not in the list, I know my carrier Bibob uses Sonofon network, so I decided to try choosing that from the menu.. but with no result, then I tried to configure it manually… Still not working.. Then I remebered I wrote a post a while back about getting the phone to work as a modem, back then I figured out that I had to change the connection string to make it work..
I found my old post, typed in the connection string on the TomTom lo and behold… It connected right away… So if you want to connect you TomTom device to you mobile with a Bibob subscription, you will have to put in the following connection string : at+CGDCONT=1,”IP”,”Internet.bibob.dk”
Most companies have GPO settings that enforces a company wide screensaver policy, in my case the screensaver kicks in after 5 min.
5 Min is a very short time, when you are doing presentations or showing video content, so I decided to create a little AutoIT script to move the mouse 1 pixel after 4 min and 59 sec.
I decided to create a small tray icon, where I can choose how many minutes I want it to run for, and the icon changes in color, when the “screensaver free” time is running out.
Opt("TrayOnEventMode",1)
Opt("TrayAutoPause",0)
Opt("TrayMenuMode",1) ; Default tray menu items (Script Paused/Exit) will not be shown.
HotKeySet("^!q", "_ExitLoop")
$DisableScreenSaver = TrayCreateMenu("Disable Screensaver")
TrayCreateItem("")
TrayCreateItem("About")
TrayItemSetOnEvent(-1, "DoAbout")
TrayCreateItem("")
TrayCreateItem("Exit (To exit pres CTRL-ALT-q)")
TrayItemSetOnEvent(-1, "DoExit")
TrayCreateItem("15 Min", $DisableScreenSaver)
TrayItemSetOnEvent(-1, "DisableScreenSaver15")
TrayCreateItem("30 Min", $DisableScreenSaver)
TrayItemSetOnEvent(-1, "DisableScreenSaver30")
TrayCreateItem("45 Min", $DisableScreenSaver)
TrayItemSetOnEvent(-1, "DisableScreenSaver45")
TrayCreateItem("60 Min", $DisableScreenSaver)
TrayItemSetOnEvent(-1, "DisableScreenSaver60")
TrayCreateItem("90 Min", $DisableScreenSaver)
TrayItemSetOnEvent(-1, "DisableScreenSaver90")
TraySetState()
TraySetIcon("shell32.dll",251)
While 1
Sleep(1000)
WEnd
Func _ExitLoop()
Exit 0
EndFunc
Func getpos()
$x = MouseGetPos(0)
$y = MouseGetPos(1)
; MsgBox ( 0, "MSG", "MousePos: "& $x &", " & $y , 1 )
MouseMove($x,$y+1,1)
endfunc
Func DisableScreenSaver15()
For $i = 1 to 3 Step 1
If $i = 1 then TraySetIcon("wpdshext.dll",714)
If $i = 2 then TraySetIcon("wpdshext.dll",711)
If $i = 3 then TraySetIcon("wpdshext.dll",710)
Sleep(299000)
GetPos()
Next
Msgbox(64,"Time is Up!","Time without screensaver is up!")
TraySetIcon("shell32.dll",251)
EndFunc
Func DisableScreenSaver30()
$begin = TimerInit()
For $i = 1 to 6 Step 1
If $i = 1 then TraySetIcon("wpdshext.dll",714)
If $i = 2 then TraySetIcon("wpdshext.dll",713)
If $i = 3 then TraySetIcon("wpdshext.dll",712)
If $i = 4 then TraySetIcon("wpdshext.dll",711)
If $i = 6 then TraySetIcon("wpdshext.dll",710)
Sleep(299000)
GetPos()
Next
Msgbox(64,"Time is Up!","Time without screensaver is up!")
TraySetIcon("shell32.dll",251)
EndFunc
Func DisableScreenSaver45()
For $i = 1 to 9 Step 1
If $i = 1 then TraySetIcon("wpdshext.dll",714)
If $i = 4 then TraySetIcon("wpdshext.dll",713)
If $i = 6 then TraySetIcon("wpdshext.dll",712)
If $i = 8 then TraySetIcon("wpdshext.dll",711)
If $i = 9 then TraySetIcon("wpdshext.dll",710)
Sleep(299000)
GetPos()
Next
Msgbox(64,"Time is Up!","Time without screensaver is up!")
TraySetIcon("shell32.dll",251)
EndFunc
Func DisableScreenSaver60()
For $i = 1 to 12 Step 1
If $i = 1 then TraySetIcon("wpdshext.dll",714)
If $i = 6 then TraySetIcon("wpdshext.dll",713)
If $i = 8 then TraySetIcon("wpdshext.dll",712)
If $i = 11 then TraySetIcon("wpdshext.dll",711)
If $i = 12 then TraySetIcon("wpdshext.dll",710)
Sleep(299000)
GetPos()
Next
Msgbox(64,"Time is Up!","Time without screensaver is up!")
TraySetIcon("shell32.dll",251)
EndFunc
Func DisableScreenSaver90()
For $i = 1 to 18 Step 1
If $i = 1 then TraySetIcon("wpdshext.dll",714)
If $i = 6 then TraySetIcon("wpdshext.dll",713)
If $i = 12 then TraySetIcon("wpdshext.dll",712)
If $i = 17 then TraySetIcon("wpdshext.dll",711)
If $i = 18 then TraySetIcon("wpdshext.dll",710)
Sleep(299000)
GetPos()
Next
Msgbox(64,"Time is Up!","Time without screensaver is up!")
TraySetIcon("shell32.dll",251)
EndFunc
Func DoAbout()
Msgbox(64,"About:","Tool by Claus T. Nielsen")
EndFunc
Func DoExit()
Exit
EndFunc
In order to make it look good, you need the file wpdshext.dll, which is available in Vista… Otherwise you will not have the changing icon, the program will work fine though.
Not pretty code, but it does what it is supposed to.
There was a question on the Minasi forum asking if someone had written a batch script to ping a bunch of servers.. So I thought: ” I have’nt, but I would like to try”.
So I started putting a few lines of batch code together, here is what I came up with.
REM Ping Servers Script @echo off for /f "tokens=*" %%a in (servers.txt) DO call :pingStuff %%a REM Here I run through a .txt file called servers.txt, and jump to "Pingstuff" with every line from the file, parsing the servername in the %%a variable :pingStuff Ping -n 1 -w 100 %1 | find /i "TTL" > NUL REM Here I ping the server 1 time. %1 is a placeholder for the 1st parameter passed to the function, here it is the servername, then I look for REM TTL, if TTL is found in the ping result (if the ping is successful) I do nothing, if it is not there I jump to the "failure", and output the server name REM to the screen. if errorlevel 1 goto failure goto end :failure echo Address %1 is not responding. :end
What I will end up with is a list of computers that are not responding, and all successful pings will not be written to the screen.
The other day I was setting up a few VmWare test environments for work, where I had to test amongst other apps Quest Recovery Manager for AD..
So I had to create some users in Active Directory, I thought I would create a PowerShell script to do that (Must keep your PS skill fresh
So I wrote a little code snippet to create a few OU’s.
#Gets the default naming context $RootDN = (Get-QADRootDSE).DefaultNamingContextDN #Name of OU going to be created in the root of "AD" $RootOUName = "Apritest" #Create "root" OU new-qadObject -ParentContainer $RootDN -type 'organizationalUnit' -NamingProperty 'ou' -name $RootOUName #Create sub OU's, create as many as you like, you only need to change the -name property in the end of the line new-qadObject -ParentContainer "OU=$RootOUName,$RootDN" -type 'organizationalUnit' -NamingProperty 'ou' -name 'Administrators' new-qadObject -ParentContainer "OU=$RootOUName,$RootDN" -type 'organizationalUnit' -NamingProperty 'ou' -name 'Marketing' new-qadObject -ParentContainer "OU=$RootOUName,$RootDN" -type 'organizationalUnit' -NamingProperty 'ou' -name 'Sales'
I wanted it to look more like a production environment, by having multiple OU’s.
A fews ago I stumbled upon a script by Brandon Shell to create users, and I thought I could use that… So I modified his code. With my new modified code it is possible to select a “base” OU, then it will go through all sub OU’s, and create x amount of users in each. The users will be named after the OU they are created in.. So an example would be TestSales1, TestSales2, TestMarketing1 etc etc.
#
#
#Enter the DN path of the OU you want to add users to
#Note I manually put in the DN of an OU in my test environment, you will have to put one in that exists in your environment
$OuPath = 'OU=Aprismo Users,DC=aprismo,DC=test'
#Number of users to create in each OU
$No = 5
Function AddUsers
{
param([string]$OUDN, [string]$OUName)
foreach($user in 1..$No)
{
$UserName = "Test$OUName$User"
$UserPassword = "P@ssw0rd123!"
$ExpiresOn = $((Get-Date).AddMonths(1))
$userDescription = "User added for Performance Testing on $(Get-date) and Expires on $ExpiresOn"
$user = New-QADUser -name $UserName `
-SamAccountName $UserName `
-Description $UserDescription `
-ParentContainer $OUDN `
-UserPassword $UserPassword
$user | Set-QADUser -AccountExpires ((Get-Date).AddMonths(1))
}
}
#This foreach loops through all OU's "below" $OUPath
Foreach ($OU in Get-QADObject -SearchRoot $OUPath -Type 'organizationalUnit'){
Addusers $OU.DN $OU.Name
}

Categories
Tag Cloud
Blog RSS
Comments RSS
Last 50 Posts
Back
Void « Default
Life
Earth
Wind
Water
Fire
Light 