Problems, solutions and workarounds: all about using, developing and implementing software across Microsoft technologies...and BTW: yes, I work for Microsoft!
Tuesday, October 02, 2012
DsGetDCName() sample
The API function DSGetDCName() is a recommended way to obtain the domain controller name by domain name etc.
Calling this function one should take care about combination of used flag combination: this is mostly the point of optimization.
To let the developer experiment with the flags I’ve build a quick app helping to check different flag combinations:
Bits and source code are available on request or here.
Enjoy!
Tuesday, September 04, 2012
Windows Server 2012 launched
Join the virtual launch event, donwload the evaluation version, learn “What’s new” and enjoy!
Sunday, September 02, 2012
“Base system device” problem, missing driver and “PCI-Bus 2 Device 6 Function 4” location
After a clean Windows installation on HP 6910p notebook with all the drivers from accompanying DVD there was still a “yellow” node in device tree with an unrecognized base system device (the system is localized in german, so the screenshots are in german as well)
The unrecognized device is located at “PCI Bus 2, Device 6, Function 4” (in german - PCI-Bus 2, Gerät 6, Funktion 4).
Neither Windows Updates nor scan the driver DVD gave answer what device isn’t recognized.
SiSoftware Sandra detected in the notebook the PCI buses and their characteristics:
Next step – detect the attached device and read it’s characteristics:
So, the unrecognized device is the “Ricoh MMC Bus Host Adapter”.
The matching driver was found on the HP driver download page
Download, install, restart, enjoy!
Monday, August 27, 2012
Install and configure TFS 2012 Express on a standalone server
Prerequisites
Use Windows Server 2008 R2 Standard SP1 computer (a virtual machine as well) with most recent required updates.
Install application server role (full IIS support recommended).
Create two OS accounts for TFS services (recommended): TFS service itself and TFS build service.
Download TFS Express ISO image (<450MB)
http://www.microsoft.com/visualstudio/11/en-us/downloads#tfs-express
and attach it to TFS server (as Image or as burned CD).
Setup
Start tfsexpress if not launched automatically.
Accept the license and install.
Setup starts.
Confirm automatic restart of the server if required.
After server restarts, the setup continues.
Setup will try to download latest updates after succeeded finish (will fail if there’s no internet connection available).
TFS service configuration
After setup wizard closes, the next wizard starts automatically – the configuration wizard.
Confirm wizard start.
Change TFS Service account context (recommended) using TFS Service account created above – click “Change”.
Enter account name and password, check entered data clicking “Test”.
Change default port number (8080) if required.
Verify changes made or continue directly.
Pre-configuration starts.
Start final configuration with “Configure”.
Configuration finalizing starts.
After configuration finishes continue with “Next”.
The final screen displays the URL to access TFS service (here http://tfsexpress:8080/tfs).
Click on the URL brings opens internet browser (here Internet Explorer, confirmation to unblock web address may appear).
Click “Add” to include the TFS service URL in the list of trusted URLs.
The Web frontend of TFS Service opens.
The wizard can be closed. Alternatively TFS build service may be configured from now.
TFS build service configuration
Continue the wizard with “Next”.
Change the project collection if not the default collection is to be used.
Configure number of build agents.
Change TFS build service account context (recommended) using TFS build service account created above, click “Test” to verify entered data.
Ensure test of entered account data succeeded, continue wizard.
Confirm the configuration settings or verify if required.
After validation of the settings start configuration with “Configure”.
Configuration starts.
After configuration finishes finish the setup with “Next”.
Review setup summary on the final screen.
Finalization
After TFS build service configuration finishes check the summary on the final wizard screen and close the wizard.
TFS express administration console open immediately.
From now you can start to use your fresh TFS express instance and enjoy it!
Friday, August 10, 2012
Check and download Windows updates online for domain member computers
Most administrators configure group policy to use a domain internal Windows Update Server (WSUS), so if you take your domain member computer off the domain network (assume notebook or virtual machine image), the system won’t be updated reporting error: cannot check for updates or cannot download updates.
Windows Update control panel displays following information:
“You receive updates:” is configured as “Managed by your system administrator” and “Check online for updates from Microsoft Update” is disabled/grayed out.
The reason is mostly configured group policy, pointing to use a domain update server (WSUS server) as update source.
You can revert your box to get updates online instead of looking for (temporarily?) unavailable update server.
Open regedit on the box and change following registry value
HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Microsoft\Windows\WindowsUpdate\AU\UseWUServer
to 0
and retry check for updates:
Refer also Microsoft KB http://support.microsoft.com/kb/328010 and enjoy!
Thursday, August 09, 2012
“Go online” problem with Windows Live Mail and MESH (Windows Live Essentials) on Windows 8
After enabling Hyper-V feature and configuring Virtual Switch on Windows 8 box we encountered very strange problem: after click on “Work offline” in Windows Live Mail window - globe button – the program won’t go back online. Each click on “Go online” is followed by
MESH also declines to start saying “There’s no internet connection” or similar.
Workaround:
- Close and exit Windows Live Mail and Mesh if running.
- Start Internet Explorer.
- Ensure “go online” notification on the bottom of internet explorer and DO NOT CLICK “Go back offline” – simply close it.
- Restart Windows Live Mail – you will see, Windows Live Mail went automatically online.
- Restart Mesh
- Enjoy!
Wednesday, August 08, 2012
Protect ASP.NET application against No-Redir browser hacks
Page redirection is a very popular approach on Web applications behavior, for example: count login errors and redirect user to an error page if login error count exceeds max allowed value – to prevent login hack attack.
The simplest way to do it in a ASP.NET application:
// Get URL of the error page to be redirected to
string urlErrorPage = getUrlErrorPage(…);
// Use Response.Redirect to redirect user to the error page
Response.Redirect(urlErrorPage, true);
The problem is, there are numerous add-ons for internet browsers to prevent redirection: like this, this and this.
One possibility to redirect mandatory is to write the content of target page in Response directly (the target page assumed to be plain HTML page):
// Use Response.Write to write error page content
string errorContent = "<html><head></head><body>error</body></html>";
string sFile = null;
try
{
sFile = Server.MapPath(urlErrorPage);
using (StreamReader sr = new StreamReader(sFile))
{
errorContent = sr.ReadToEnd();
}
}
catch (Exception ex)
{
// Handle exception
}
finally
{
Response.Write(errorContent);
Response.End();
}
Once again: the target error page assumed to be (D)HTML page.
Enjoy!
Monday, August 06, 2012
Windows Server 2012 is RTM now
For anyone, who doesn’t follow MSDN news: WS2012 is RTM.
Stay online with TechNet evaluation center and enjoy!
UPD: do not miss 4th September – Windows Server 2012 availability start
UPD: do not miss Windows Server 2012 Essentials (currently beta)
Saturday, August 04, 2012
GhostScript error using FreePDF with network share
Some workstations in a Windows Domain (checked with SBS 2003 latest SP and Windows Server 2008 R2 latest SP) have problem saving PDF documents from FreePDF printer.
One of the reason: network share as destination folder – the document is created but copy to the target folder fails generating GhostScript error message.
Workaround: save result PDF document to a local folder and the copy to network share destination.
Enjoy!
Wednesday, August 01, 2012
Problem: "The user name or password is incorrect" if you try to connect to SBS 2003 based network share or Exchange via Outlook
Situation: there is a number of client computers in a local SBS 2003 based domain. Every computer but one is domain member and runs Windows XP SP3. All users have access to network share (via explorer) and mailboxes (via Outlook 2003/2010) on the SBS 2003 SP2 server in the domain.
Suddenly the only non-domain computers – a workgroup computer – gets no access to network share and to Exchange mailbox. The user gets repeating error message
"The user name or password is incorrect"
The same username/password pair succeeds on every other computer in the LAN.
The most popular problem is: the clock on the client computer and on the serve are not synchronized. In our case: somebody misconfigured client’s date/time setting the next month as current, so the date/time difference between client and server was 1 month.
After setting client’s date/time same as on the server the access to network shares and Exchange account via Outlook was restored immediately.
So, in case of same or similar error message
- check the date/time settings on the server
- check the date/time settings on the client computer
- compare and synchronize them if required
Enjoy!
Monday, July 30, 2012
Writing this post from Windows 8 To Go
Amazing! I enjoy my Windows 8 To Go on single USB stick.
First impressions: Windows 8 Enterprise
on a 16 GB RAM box uses 23 GB of 32 GB USB Disk
with following software/features installed on Win8:
- Hyper-V Management Tools (to control my GUI-less Windows Hyper-V Server)
- MS System Center 2012 Endpoint Protection
- MS Office 2010 Professional Plus 2010
- Skype
- Windows Live Essentials