Print

How to add metadata to a folder in SharePoint

Written by Daniel Mundy on Friday, 28 October 2011 11:26.

How to add metadata to a folder: http://sharepoint-guru.blogspot.com/2007/06/adding-metadata-to-folder.html

You can also change existing folders, no need to re-create. Just select the folder and on the Documents tab click Edit Properties.

 

Print

Use the old style task bar in Windows 7

Written by Daniel Mundy on Friday, 28 October 2011 09:16.

Does anyone actually like the new Windows 7 taskbar? I prefer the old style which 

You can change it back manually by right-clicking on the taskbar, selecting properties, and ticking the following two options:

  • Use small icons
  • Taskbar buttons: Never combine
Now you will have the old style taskbar!

sshot-2011-10-28-1

What if you want to script it? The change is made in the registry, you can import the registry file by using the following command: reg import settings.reg

 

 

Put the following into settings.reg:

Windows Registry Editor Version 5.00
[HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced]
"TaskbarSmallIcons"=dword:00000001
"TaskbarGlomLevel"=dword:00000002
Print

You will not be able to install a read-only domain controller in this domain because "adprep /rodcprep" was not yet run

Written by Daniel Mundy on Wednesday, 26 October 2011 16:17.

When promoting the first Server 2008 R2 DC in a 2003 domain, I got the following warning:

Active Directory Domain Services Installation Wizard
You will not be able to install a read-only domain controller in this domain because "adprep /rodcprep" was not yet run.

 

The following was in the error log:     (these are in C:\WINDOWS\Debug\adprep\logs)

Adprep found partition DC=DomainDnsZones,DC=mydomain,DC=local, and is about to update the permissions.
[2011/09/07:15:24:42.609]
Adprep was about to call the following LDAP API. ldap_search_s(). The base entry to start the search is CN=Infrastructure,DC=DomainDnsZones,DC=mydomain,DC=local.
[2011/09/07:15:24:42.609]
LDAP API ldap_search_s finished, return code is 0x0
[2011/09/07:15:24:42.609]
Adprep could not contact a replica for partition DC=DomainDnsZones,DC=mydomain,DC=au.
[2011/09/07:15:24:42.625]
Adprep encountered an LDAP error.

Error code: 0x0. Server extended error code: 0x0, Server error message: (null).
[2011/09/07:15:24:42.625]
Adprep failed the operation on partition DC=DomainDnsZones,DC=mydomain,DC=local. Skipping to next partition.

==============================================================================
[2011/09/07:15:24:42.640]
==============================================================================

Adprep found partition DC=ForestDnsZones,DC=mydomain,DC=local, and is about to update the permissions.
[2011/09/07:15:24:42.640]
Adprep was about to call the following LDAP API. ldap_search_s(). The base entry to start the search is CN=Infrastructure,DC=ForestDnsZones,DC=mydomain,DC=local.
[2011/09/07:15:24:42.656]
LDAP API ldap_search_s finished, return code is 0x0
[2011/09/07:15:24:42.656]
Adprep could not contact a replica for partition DC=ForestDnsZones,DC=mydomain,DC=local.
[2011/09/07:15:24:42.656]
Adprep encountered an LDAP error.
Error code: 0x0. Server extended error code: 0x0, Server error message: (null). [2011/09/07:15:24:42.671] Adprep failed the operation on partition DC=ForestDnsZones,DC=mydomain,DC=local. Skipping to next partition.

The fix was to run the script in http://support.microsoft.com/kb/949257

I had to run the script for both zones that were referenced in the error log. This example is for mydomain.local, make sure to change the parameters for your own environment.

cscript fixfsmo.vbs DC=DomainDnsZones,DC=mydomain,DC=local
cscript fixfsmo.vbs DC=DC=ForestDnsZones,DC=mydomain,DC=local

Then I ran adprep32.exe /rodcprep again, and it failed. I ran it one more time and it succeeded. Now I don't get the warning when running dcpromo.

Print

Force small taskbar using group policy

Written by Daniel Mundy on Tuesday, 13 September 2011 16:17.

I like to force small taskbar and also disable grouping.

To disable grouping, the policy is:

User Configuration \ Policies \ Administrative Templates \ Prevent grouping of taskbar items = Enabled

There is no policy to force small taskbar, but there is a registry setting. Therefore we can make a custom ADM file (source: http://social.technet.microsoft.com/Forums/ar/w7itproui/thread/eb25d68d-41cc-4188-a00c-7342992dad05)

 

Create a file with the extension .ADM  mine is Taskbar Extra.ADM on your Domain Controller

Insert this into the file and make sure you save it as .ADM and not .txt

CLASS USER

CATEGORY "Taskbar Extras"

KEYNAME "Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced"

POLICY "Enable small icons for the taskbar"

EXPLAIN "Enabling this policy will enforce the use of small icons in the taskbar.  If not enabled it or disabled large icons will be used.  This 

Should work for Windows 7 and Vista"  

VALUENAME "TaskbarSmallIcons"

VALUEON NUMERIC 1

VALUEOFF NUMERIC 0

END POLICY

END CATEGORY

Now go into your User GPO you have created you want to attach this to.

So drill down to "User Configuration" > Policies and right click on "Administrative Templates" and select  "Add/Remove Templates"

Click Add and browse to your ADM file and click Close to "Save", if you get no pop ups it was added ok, if you get a pop up it will tell you the error.

Simply Remove and re-add the same ADM to "Update" it if you make changes.

Now in your GPO drill down to "User Configuration" > Policies > "Administraive Templates" > "Classic Administrative Template" and you should see the new GPO we created, enable it and apply to your OU(s) and that should be it.

Print

How does a PC know which DHCP scope to use?

Written by Daniel Mundy on Tuesday, 13 September 2011 12:01.

This was such a good explanation I had to copy it down so I can find it again. Source: http://forums.anandtech.com/showthread.php?t=1249649

"You can set up all the scopes for different subnets you want, but your DHCP server will only hand out an IP for a different subnet if the request comes through a router or a DHCP relay agent. This request will be a multi cast, the packet will contain the IP info from the subnet the request originated from and the DHCP server will hand out an address from the co-responding scope.

If the DHCP request arrives as a broadcast, this means the requesting host is on the same subnet. The DHCP server will hand out an IP from a scope that handles it's own subnet.

Certian Routers can forward DHCP requests, but as a general rule broadcasts don't pass through routers. So if a DHCP server recieves a request in the form of a broadcast it knows to dishout an IP on it's own subnet. 

If a DHCP request comes in by way of a DHCP relay agent or a compliant router, the packet will contain info about its originating subnet. THat's how the DHCP server knows what scope to hand out an IP from.

This is all handled automagically by the DHCP server."

 

Print

Billion Hidden Pages

Written by Daniel Mundy on Tuesday, 06 September 2011 17:26.

http://192.168.123.254/configuration/PortCtrl.html = Ethernet Port Control (Speed and mode settings)
http://192.168.123.254/configuration/adsl.html = DSL Stats (SNR, Noise, Sync etc etc ...)
http://192.168.123.254/configuration/adsl_diag.html = ADSL Line Analyzation (Logs COMPLETE Instant ADSL Stats)
http://192.168.123.254/configuration/blkhack.html = Intrusion Detection On/Off option page
http://192.168.123.254/configuration/blockwan.html = Block WAN Request On/Off option page
http://192.168.123.254/configuration/customer.html = Lists some info such as firmware,WAN, also admin password in plain text
http://192.168.123.254/configuration/do_hostscript.html = ???? Browser Timeout but lights flashed on modem
http://192.168.123.254/configuration/home.html = As it says Home (Main Status Page)
http://192.168.123.254/configuration/hostname.html = Hostname for Router (defualt home.gateway)
http://192.168.123.254/configuration/ic.html = Parameters (max connections etc...)
http://192.168.123.254/configuration/iptv.html = Noise margin options, "test" & "others" seem to increase sync
http://192.168.123.254/configuration/lan_conf_apply.html = Apply Page for above (Froze Modem when loading strait to this)
http://192.168.123.254/configuration/locale_en.html = Returns Me to Status Page/ index.htm/ home.html


Print

No password on wake from sleep in Ubuntu

Written by Daniel Mundy on Thursday, 23 June 2011 18:00.

System -> Preferences -> Screensaver. Uncheck "Lock screen when screensaver is active".

Then type the following in the terminal:

#gconftool --type Boolean --set /apps/gnome-power-manager/lock/suspend false

 

Print

Restore Files Hidden by Virus

Written by Daniel Mundy on Tuesday, 14 June 2011 09:38.

attrib -s -h *.* /S /D

 

Print

Record Logons and Logoffs in a CSV file

Written by Daniel Mundy on Tuesday, 07 June 2011 10:32.

Create a folder C:\Scripts and share it as Scripts$, make sure domain users have write access to it. (append may be enough, I haven't tested it yet)

Put the settings in the default domain policy:

  • User Configuration / Policies / Administrative Templates / System / Logon / Run these programs at user logon = \\servername\Scripts$\log_on.vbs
  • User Configuration / Policies / Windows Settings / Scripts / Logoff = \\servername\Scripts$\log_off.vbs

Save the following file as C:\Scripts\log_on.vbs:

'--------------------8<----------------------

' UNC path and name of the central log file,
' be sure all users have write access to it

sLogFilePath = "\\servername\CaramelScripts$\log_on_off.csv"

' Use e.g. "Logon" on the logon script, and "Logoff" in the logoff script
sType = "Logon"

Const OpenAsASCII = 0
Const OverwriteIfExist = -1
Const ForAppending = 8

Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oWshNetwork = CreateObject("WScript.Network")
Set oADSystemInfo = CreateObject("ADSystemInfo")

Set wshShell = CreateObject("WScript.Shell")
sClientName = "Not recorded"
sClientName = wshShell.ExpandEnvironmentStrings("%CLIENTNAME%")

sDateTime = Now

sComputer = oWshNetwork.ComputerName
sUser = oWshNetwork.UserName

Set oUser = GetObject("LDAP://" & oADSystemInfo.UserName)
sUserOU = Mid(oUser.Parent, 8)

' create a proper CSV format so it is easy to import to e.g. Excel
sLogLine = """" & sType & """,""" & sDateTime & """,""" & sUser _
& """,""" & sComputer & """,""" & sClientName & """,""" & sUserOU & """"

If oFSO.FolderExists(oFSO.GetParentFolderName(sLogFilePath)) Then

' Create entry in log file.
' If script is not able to open the file for write access, it
' will go into a loop and try several times, but will give up
' after 5 seconds (10 loops)
bUpdLogFinished = False
iLoops = 0

On Error Resume Next
Do
Err.Clear
' Open for appending
Set fLogFile = oFSO.OpenTextFile(sLogFilePath, ForAppending, True)
If Err.Number <> 0 Then
' Was not able to open the log file for writing
' Waiting 1/2 a second before trying again
WScript.Sleep 500
Else
fLogFile.WriteLine sLogLine
fLogFile.Close
bUpdLogFinished = True
End If
iLoops = iLoops + 1
Loop Until bUpdLogFinished Or iLoops > 10

On Error Goto 0

End If

'--------------------8<----------------------

Save the following file as C:\Scripts\log_off.vbs:

'--------------------8<----------------------

' UNC path and name of the central log file,
' be sure all users have write access to it

sLogFilePath = "\\servername\Scripts$\log_on_off.csv"

' Use e.g. "Logon" on the logon script, and "Logoff" in the logoff script
sType = "Logoff"


Const OpenAsASCII = 0
Const OverwriteIfExist = -1
Const ForAppending = 8

Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oWshNetwork = CreateObject("WScript.Network")
Set oADSystemInfo = CreateObject("ADSystemInfo")

sDateTime = Now

sComputer = oWshNetwork.ComputerName
sUser = oWshNetwork.UserName

Set oUser = GetObject("LDAP://" & oADSystemInfo.UserName)
sUserOU = Mid(oUser.Parent, 8)

' create a proper CSV format so it is easy to import to e.g. Excel
sLogLine = """" & sType & """,""" & sDateTime & """,""" & sUser _
& """,""" & sComputer & """, ,""" & sUserOU & """"

If oFSO.FolderExists(oFSO.GetParentFolderName(sLogFilePath)) Then

' Create entry in log file.
' If script is not able to open the file for write access, it
' will go into a loop and try several times, but will give up
' after 5 seconds (10 loops)
bUpdLogFinished = False
iLoops = 0

On Error Resume Next
Do
Err.Clear
' Open for appending
Set fLogFile = oFSO.OpenTextFile(sLogFilePath, ForAppending, True)
If Err.Number <> 0 Then
' Was not able to open the log file for writing
' Waiting 1/2 a second before trying again
WScript.Sleep 500
Else
fLogFile.WriteLine sLogLine
fLogFile.Close
bUpdLogFinished = True
End If
iLoops = iLoops + 1
Loop Until bUpdLogFinished Or iLoops > 10

On Error Goto 0

End If

'--------------------8<----------------------