29 April 2010

WINS - access denied to wins server in wins mmc

And just as we thought wins was dead.....
it comes right back and keeps hunting you.

The case:
I had to install the WINS service on a DC.
No problem - easy and fast done..
BUT... when starting the WINS mmc... ACCESS DENIED to the wins server !!!!

well... the solution
edit permissions on reg-key HKEY_LOCAL_MACHINE\SYSTEM\CurentControlSet\Control\SecurePipeServers\winreg

"LOCAL SERVICE" needs to be added with Read permissions.

Then it worked.....

WII - SoftMod

I've softmod'ed my WII
- it works so great :-)

All games are now running from an external USB harddrive,
and in the menu, I just go through all the covers to find the game I want to play.

And it is so easy to do
the guidence make it so easy,
it guides you through the setup and download/use of programs

Find it here:
http://wiinyt.dk/forum/discussion/1877/1/softmod-42-guide-v9/

I have moved my channels a little around, so that Wii-Flow (the usb-loader I use)
so that I easyli have access to my games.

Starting SCOM console with cache cleared

Fire the following command to launch SCOM Console UI with a cleared cache:


Run: "C:\Program Files\System Center Operations Manager 2007\Microsoft.mom.ui.console.exe" /ClearCache

Service Broker alerts

How to check if the Service Broker is enabled
- and how to enable if not...

Log on to SQL and execute query: SELECT is_broker_enabled FROM sys.databases WHERE name=’OperationsManager’
If it returns 1, don’t read any further, if not:
Execute: ALTER DATABASE OperationsManager SET SINGLE_USER WITH ROLLBACK IMMEDIATE
Execute: ALTER DATABASE OperationsManager SET ENABLE_BROKER
Execute: ALTER DATABASE OperationsManager SET MULTI_USER
Restart OpsMgr SDK Service

Logs on CrossPlatform agent installation

When instaling CrossPlatform SCOM agents, default no logs are created to help troubleshooting.

Using this litlle trick, SCOM will generate these logs

In the Windows\Temp folder create following file: EnableOpsMgrModuleLogging

After this file is created, SCOM will generate logfiles in the Windows\Temp folder when installing CrossPlatform agents.

To stop these logfiles, delete the EnableOpsMgrModuleLogging-file.

Upgrading Windows 2000 Active Directory to 2008 Directory Service

Sounds like a piece of cake...
* Extend the scheme
* Bring up 2 new windows 2008 servers
* Run DCPROMO
* Configure DNS
* Move FSMO roles to new 2008 DCs
* Move DHCP
* Demote the old windows 2000 servers (then disjoin from the domain)
* Clean up in AD Sites and Services (the old servers don't remove themselves)

Well....
From the 2008 media Run adprep /forestprep
It seems to run smoothly.. almost to the end...
Then an error - a file did not exist. !!!
After a long time investigation, I turned of Antivirus... and now the scheme update ran to the end... succesfully.

Adprep /domainprep /gpprep
Adprep /rodcprep

The configuring DNS before moving the FSMO roles (using NTDSUTIL.... much easier than the GUI).

Actually - after the first hurdle, it all ran smoothly, following my steps described above...
well until I reached the DHCP..
Of course NETSH are very different from Windows 2000 to windows 2008.
So.. on the w2k box I did a NETSH DHCP Backup,
moved the file to the w2k8 box, did some editing (removed unwanted stuff, and the w2k dhcp server name)
then I ran NETSH DHCP Restore - and YES.... it worked...

Managing Windows 7 Deployment with DISM

Using DISM to configure Windows 7


Starting DISM

The first thing we need to do in order to run DISM is have an elevated command prompt open.
Simply going Start –> Run –> cmd –> Enter won’t do the trick as that runs with user privileges.
What we need to do is either do Start –> Run –> Cmd –> Shift+CTRL+Enter
or Click on Start type cmd and when it appear in the search box, right click on it and choose “Run as Administrator”:



Once we’ve got the elevated command prompt open
– we can check this by looking in the task bar and the title should be prefixed by “Administrator: “



Now if we type “dism” we should get help about dism. If you get the message:

Error: 740

Elevated permissions are required to run DISM.
Use an elevated command prompt to complete these tasks.

Then you didn’t successfully get a command prompt with elevated privileges open.



Finding Basic Information With DISM

Now that we’ve got our command prompt ready for action, we can find some basic information about the OS we’re currently running. At the prompt type:

dism /online /Get-CurrentEdition

This tells dism we want to use the current version (/online) and the command – similar to PowerShell – tells dism we want to get information about the current edition (/Get-CurrentEdition). Proving successful the results should return something like:

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Current edition is:

Current Edition : Ultimate

The operation completed successfully.

Now let’s take it one step further. As there are different versions of Windows 7 available, we have the potential to upgrade. If we run dism (referencing the online image - /online) with /Get-TargetEditions, it will tell us what versions we can upgrade to (if at all possible). So, if I run

dism /online /Get-TargetEditions

against a machine that is already running Windows 7 Ultimate, DISM should return:

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Editions that can be upgraded to:

(The current edition cannot be upgraded to any target editions.)

The operation completed successfully.

So, scripting the above can prove useful if we need to interrogate or find information about our existing machine or its capabilities.

Changing the System with DISM

As well as querying the system for information, one of the most powerful features of DISM is its capability to “service” an “online” or live image. This allows us the capability to change the OS on the fly. For example, Windows 7 ships with numerous games and features installed that we might not want as part of our corporate build. Using the functionality built in to DISM – whilst the OS is running – we can remove these features.

First, let’s look at what is installed and what we can change. To do this, at the prompt we need to type:

dism /online /Get-Features | more

Again, we reference the current version (/online) and we use the command /Get-Features to show us the currently installed features. The “| more” simply paginates the output so we can see it without having to scroll. If we look through the list some of the features we want to remove can be seen:

….

Feature Name : FreeCell
State : Enabled

Feature Name : Minesweeper
State : Enabled

Feature Name : PurblePlace
State : Enabled

….

As the state of these currently shows “Enabled” we want to remove or disable them. Using DISM, we can easily do this. At the prompt we can type:

dism /online /Disable-Feature /FeatureName:

Where we simply replace with the feature from the list of results we got using /Get-Features. NOTE: The features are CaSe SEnSItivE. As an example, if we wanted to remove PurblePlace, we could simply enter:

dism /online /Disable-Feature /FeatureName:PurblePlace

at which time DISM will kick in and should return results like the following:

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Disabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.

Let’s now check to see if it was disabled:

dism /online /Get-FeatureInfo /FeatureName:PurblePlace

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Feature Information:

Feature Name : PurblePlace
Display Name : Purble Place
Description : Purble Place
Restart Required : Possible
State : Disabled

Custom Properties:

(No custom properties found)

The operation completed successfully.

As we can see “State : Disabled” means we’ve disabled it. Should we want to re-enable it, we can simply type:

dism /online /Enable-Feature /FeatureName:PurblePlace

At which time DISM will put the feature back on the machine in a similar way it removed it:

Deployment Image Servicing and Management tool
Version: 6.1.7100.0

Image Version: 6.1.7100.0

Enabling feature(s)
[==========================100.0%==========================]
The operation completed successfully.

Conclusion

As you can see DISM is a very powerful tool and the introduction of online/live servicing makes it even more useful to the IT professional. To get more information about DISM or any of its functions or capabilities, use the /? flag when you get stuck. Some examples include:

“dism /?” – which will tell you about the root level capabilities
“dism /online /?” – which will tell you about the online image servicing capabilities
“dism /online /Get-Features /?” – which will tell you about the Get-Features function
And from there, the sky’s the limit. Happy DISM’ing.

Missing Hibernate in Vista after running "Disk Cleanup Tool"

After running "Disk Cleanup Tool" on Vista the Hibernation possibility was disappered.

Run: powercfg -h on

A restart is needed

Script: List all users in AD in a csv file

This script will list all users in AD in a csv file
Showing this:
SAM navn, Full name, Description, Office, OU placering
in file users.csv, createt in same folder as the script.

I'm using RootDSE, so no need for "hardcoding" domain name.

Scriptet:

' LIST_USERS.VBS
' ver. 1.0 - 070509
'
on error resume next
Set objRootDSE = GetObject("LDAP://RootDSE")
objDomain = objRootDSE.Get("defaultNamingContext")
set objConn = CreateObject("ADODB.Connection")
set objCmd = CreateObject("ADODB.Command")
objConn.Provider = "ADsDSOObject"
objConn.Open "Active Directory Provider"
Set objCmd.ActiveConnection = objConn
objCmd.Properties("Cache Results") = False
strFilter = "(&(objectclass=user)(objectcategory=person))"
strQuery = ";" & strFilter & ";distinguishedName;subtree"
objCmd.CommandText = strQuery
Set objFSO=Createobject("Scripting.FileSystemObject")
objCSVfile = "Users.csv"
Const ForReading = 1
Const ForWriting = 2
Const ForAppending = 8

if objFSO.FileExists(sUsersLeft) then
objFSO.deletefile(sUsersLeft)
end if

Set objLogFile = objFSO.CreateTextFile(objCSVfile)
objLogFile.Write("SAM Name, Display Name, Description, Office, OU" & chr(13) & chr(10))
Set objRecordSet = objCmd.Execute

Do Until objRecordSet.EOF
strDN = objRecordSet.Fields("distinguishedName")
Set objUser = GetObject("LDAP://" & strDN)
strsAMAccountName = objUser.sAMAccountName
strsdisplayName = objUser.displayName
strDescription = objUser.description
strOffice = objUser.physicalDeliveryOfficeName
strOU = objUser.distinguishedName
arrOU = split(strOU,",")
strOU = ""
for each i in arrOU
if left(i,2) = "OU" then
arrTmp = split(i,"=")
strOU=arrTmp(1) & "\" & strOU
end if
next
objLogFile.Write(strsAMAccountName & ", " & strsdisplayName & ", " & strDescription & "," & strOffice & "," & strOU & chr(13) & chr(10))
objRecordSet.MoveNext
Loop
objLogFile.close
objConn.Close
Set objGroup = Nothing
Set objRootDSE = Nothing
Set objCmd = Nothing
Set objConn = Nothing

FSMO role Schemamaster on a x64 Domain Controller

The DC holding the FSMO role Schemamaster controlls all changes to the schema.
To make changes to the schema, you need access to the schemamaster.
There can only be ONE schemamaster.

Transfering the Schemamaster role:

Use MMC snap-in Active Directory Schema Master to transfer schemamaster role.
Before using the snap-in, the Schmmgmt.dll has to be registered:

Start -> Run
execute: %windir%\system32\regsrv32.exe schmmgmt.dll

Transfering the Schemamaster role:
Start -> Run, type mmc
Add/remove Snap-in
Add
Add Active Directory Schema

In the consoletree, right click on Active Directory Schema, and click Change Domain Controller.
Supply name for the domain controller that now shall hold the schemamaster role.
In the consoletree, right click on Active Directory Schema, and click Operations Master.
Click Change

How to promote a 2003 64-bit R2 to domain controller in a non-R2 domain

In one of life’s “chicken and egg” situations I recently encountered the issue of promoting a Windows Server 2003 64-bit R2 server to be a Domain Controller in an environment with only Windows Server 2003 32-bit (non-R2) servers as existing Domain Controllers.

Running DCPromo on the 64-bit R2 will tell you that the Forest has not been prepared for the version of Windows you are trying to promote.
This would normally not be a problem, since the R2 media contains an adprep.exe to update the schema for R2 Domain Controllers.

Of course if you take your new 64-bit R2 disc 2 media and try to run adprep on the 64-bit server you will receive this error:

C:\WINDOWS\CMPNENTS\R2\ADPREP>adprep /forestprep
Adprep cannot run on this platform because it is not a domain controller.
[Status/Consequence]
Adprep stopped without making any changes.
[User Action]
Run Adprep on a domain controller.Makes sense, so of course you put the disc into your existing Domain Controller and run adprep again.

Z:\>adprep /forestprep
The image file Z:\ADPREP.EXE is valid, but is for a machine type other than the
current machine.Thats right, you can’t use your 64-bit media to run adprep on a 32-bit Domain Controller. This is where the chicken and egg scenario kicks in – how do you get your 64-bit R2 server to be a Domain Controller with no pre-existing 64-bit or R2 Domain Controllers available for the required schema update? Its not like Microsoft ships you a 32-bit copy of the OS when you buy the 64-bit edition.

The solution is to get your hands on the 32-bit R2 media. You only need disc 2 which contains the R2 adprep.exe and schema files.
Or - from Microsoft - get this hotfix that contains only the R2 adprep files.