Thursday, June 5, 2014

WDS Server Service Not Starting

I ran into an issue after I had a server go down. I found that my WDS Server Service would not start. The issue with my server was a bad system board, I replaced it and was able to boot the server no problem. Everything else came up. This server (Windows Server 2008) is a DNS, DCHP, and AD domain controller to go with WDS. I tried to start WDS in Server Manager and wasn’t getting anywhere. I first had to turn on logging to try and get a better understanding of what was going on. To do so, you need to make some changes to the registry. An article from Microsoft can be found here on the process of turning on the traces. I started by uninitializing the WDS Server first with this command…

wdsutil /Verbose /Progress /Uninitialize-Server

then I initialized it with this command…

C:\Windows\system32>wdsutil /Verbose /Progress /Initialize-Server /REMINST:c:\RemoteInstall

I then got…

Starting Windows Deployment Services services...

An error occurred while trying to execute the command.
Error Code: 0x41D
Error Description: The service did not respond to the start or control request in a timely fashion.

So it was then on to look at the errors and traces.
The event log looked like this…






























So my issue seems to lie with the WDSMC provider for WDS (Event ID 513 - WDSServer), but let’s take a closer look at the trace files.

[5464] 09:26:14: WDS Diagnostics Initialized
[5464] 09:26:14: [Profiles] Initialized.
[5464] 09:26:14: [MCSCOPE] Address Range=239.0.0.1-239.0.0.254, Count=254
[5464] 09:26:14: [UDPPorts] Dynamic Port Range: 64001-65000.
[5464] 09:26:14: [RPC] Using Tcp Port 5040 for Rpc Calls.
[5464] 09:26:14: [RPC] Client Impersonation Logging=Disabled
[5464] 09:26:14: [RPC] Host Name: server.domain.com
[5464] 09:26:14: [RPC] NTLM/Kerberos Spn: ldap/server.domain.com
[5464] 09:26:14: [RPC] Initialized
[1732] 09:26:14: [RPC] Server Started.
[5464] 09:26:14: WDS VSS Writer Pre-Initialized
[5464] 09:26:14: [BINLSVC][RPC][Ep={5F4FB9F0-C0E3-41C1-AA00-9A7C690AC3A3}] Registered
[5464] 09:26:14: [BINLSVC] Provider Initialized.
[5464] 09:26:14: [437][WdsImgSrv] -> Initialize
[5464] 09:26:14: [656][WdsImgSrv] -> pInitializeManagement
[5464] 09:26:15: [1671][WdsImgSrv] <- pInitializeManagement=0
[5464] 09:26:15: [1671][WdsImgSrv] -> pWdsImgSrvRefreshSettings
[5464] 09:26:16: [2343][WdsImgSrv] <- pWdsImgSrvRefreshSettings=0
[5464] 09:26:16: [WdsImgSrv][RPC][Ep={D8DEEB5A-EFFD-43B2-99FC-1A8A5921C227}] Registered
[5464] 09:26:16: [2343][WdsImgSrv] <- Initialize=0
[5464] 09:26:16: [WdsImgSrv] Provider Initialized.
[5464] 09:26:16: [d:\longhorn\base\ntsetup\opktools\wds\wdssrv\server\src\wdsprovider.cpp:147] Expression: , Win32 Error=2148073483
[5464] 09:26:16: [WDSMC] Initialization Failed (rc=2148073483)
[5464] 09:26:16: [d:\longhorn\base\ntsetup\opktools\wds\wdssrv\server\src\wdsprovhdl.cpp:169] Expression: , Win32 Error=2148073483
[5464] 09:26:16: [WDSMC] Deleted.
[5464] 09:26:16: [d:\longhorn\base\ntsetup\opktools\wds\wdssrv\server\src\wdsservice.cpp:177] Expression: , Win32 Error=2148073483
[5464] 09:26:16: [Udp] Listen Shutdown.
[5500] 09:26:16: [NetMon] Network Interface(s) Change Notification
[1732] 09:26:16: [RPC] Server terminated (rc=0)
[5464] 09:26:16: [RPC] Listen Stopped.
[5464] 09:26:16: [BINLSVC] Shutting down
[5464] 09:26:16: [BINLSVC][RPC][Ep={5F4FB9F0-C0E3-41C1-AA00-9A7C690AC3A3}] Closed
[5464] 09:26:16: [BINLSVC] Deleted.
[5464] 09:26:16: [WdsImgSrv] Shutting down
[5464] 09:26:16: [2375][WdsImgSrv] -> Shutdown
[5464] 09:26:16: [WdsImgSrv][RPC][Ep={D8DEEB5A-EFFD-43B2-99FC-1A8A5921C227}] Closed
[5464] 09:26:16: [2390][WdsImgSrv] <- Shutdown=0
[5464] 09:26:16: [WdsImgSrv] Deleted.
[5464] 09:26:16: [d:\longhorn\base\ntsetup\opktools\wds\wdssrv\server\src\ifmonitor.cpp:174] Expression: , Return Value=1 (WSLE=10038)
[5464] 09:26:16: Timer Queue deleted successfully.
[5464] 09:26:16: WDS Vss Writer Shutdown
[5464] 09:26:16: WDS Diagnostics Shutdown?

The main error I saw was here…

[5464] 09:26:16: [d:\longhorn\base\ntsetup\opktools\wds\wdssrv\server\src\wdsprovider.cpp:147] Expression: , Win32 Error=2148073483
[5464] 09:26:16: [WDSMC] Initialization Failed (rc=2148073483)

One that happened it stopped everything else. So it was having issues starting the WDSMC provider, which is multi-casting provider.

A few things I checked were…
1) Reinstalling WDS

None of these worked. But this article got me thinking about what might be happening. It had to be something wrong with registry in the data. So I backed up the current registry entry for WDSMC by exporting the key (HKLM\SYSTEM\CurrentControlSet\Services\Providers\WDSMC). And then I deleted it, the whole WDSMC key there. I figured what the heck I knew it could really mess up something, but hey I have it backed up and can insert if need me. And I know most experts would say that it is dangerous and you shouldn’t do so, but hey I was frustrated and wanted the darned thing to work. The other reason was that I didn’t care if WDSMC (WDS Multicast Server) worked, I don’t use that. So I went for it. I then tried to start the service, and eureka! it started. I still do caution, that I do not highly recommend this solution but I thought my experience would help others investigating this issue and that the problem seems to lie within the registry settings for the WDSMC. Since I do not use WDSMC, I will not be investigating any further myself.

Thursday, May 29, 2014

JavaScript to Pull Information from SubGrid on CRM Form to Text Field

I had a need to pull information from a subgrid into a text field. With CRM 2011’s limit on 62 fields for a Mail Merge and the need to input related entity information in there as well, I needed to make one field contain the information. So I created a text field to hold information and thus I needed a JavaScript to fill the field in with the information. So I have a subgrid of a many to many relationship on one of my forms, and that has all the information I need to put in the information in my text field I will be using for the mail marge. I did a lot of searching on the web, and I couldn’t really find what I was looking for. I did come across this post that helped immensely. This code helped me get to my final solution.

function SubGridLookup()
{
                // Load Subgrid from page
                var subgrid = Xrm.Page.ui.controls.get('SubGridName')._control;
                var ids = subgrid.get_innerControl();
               
                // Pull all GUIDs for lookup
                ids = ids.get_allRecordIds();

                // Setup Variables
                var cellValue;
                var fldValue = "";
                var expat = Xrm.Page.getAttribute("mailmergefieldname");
               
                // For each GUID given pull the name of the entity and add it to fldvalue
                for(i = 0; i < ids.length; i++) {

                                cellValue = subgrid.get_innerControl().getCellValue('fieldname', ids[i]);
                                fldValue = fldValue+ "- " + cellValue + "\n";
               
                } // for

                // Set field with the new field value
                expat.setValue(fldValue);          
               
} // SubGridLookup

So to step through this, first I will load the subgrid on my CRM form and then I need to get all the GUIDs of the entries in that subgrid lookup. Next I will set the values of the variables I will be using. Then we need a for loop to step through each value. We do this with the getCellValue() function on the subgrid. The key is to also invoke the get_innerControl function as well. The variables it takes is the name of the field (this is the actual field name, in my case is was from the entity it was pulling the information from) you are trying to pull and the GUID which is what you get from ids[i]. If you are having issues, figuring it out, try some alerts in there to see what you are actually pulling. I then take that value and concatenate it on so that I am putting each value in one variable to add at the end with the setValue command.
This then puts in my field like so…
- Value1
- Value2
- Value3
- Value4

And so on.

Hope this helps someone.

Thursday, April 17, 2014

Latest Java Update Blocking Certain Web Sites

We were getting this error after we updated to the latest Java version (51)…

“Your security settings have blocked an untrusted application from running.”
Before this the site was suggesting we upgrade to the latest version.
So it is blocking a particular site from running the Java applet. Take note of the full site name under Location.
Next go in to Control Panel and access the Java Control Panel
Under the Security tab is the Edit Site List, click that button.

Type in the site you saw on the pop up error under location.

Hit OK and launch the Java applet again.
You should get an error like this.

Hit run if you feel safe to run.
This new feature is an interesting addition to the latest version of Java, most likely in an effort to squash many exploitations and prevent nasties. But this will likely affect a lot of internal applications and sites as well for businesses.