Search This Blog

Wednesday 25 January 2017

AppFabric installation failed because installer MSI returned with error code : 1603

Installing AppFabric on Windows Server 2012

Here is the step by step guide to installing AppFabric on Windows Server 2012. If you were to install the executable straightaway, it will fail as there are some dependencies

This is what you will see when you simply install AppFabric on a clean install of Windows Server
















removing the extraneous " corrected the issue
To change this, go to Control Panel -> System -> Advanced System Settings -> On the Advanced Tab Select Environment Variables -> Under System Variables there is a Variable named PSModulePath, select it -> Click Edit.



Here deletes existing entry if we have any other and create new entry by clicking on new and save the same.
Variable Name:
PSModulePath

Variable Values:
 %SYSTEMROOT%\System32\WindowsPowerShell\v1.0\















Second Thing go to Task Scheduler.
“\Microsoft\Windows\AppFebric\Customer Experience Improvement Programe\Consolidator”.
Remove the Task.








To properly setup AppFabric, you need to install the pre-requisites (IIS and ASP.NET 3.5) as well as enable automatic windows update.

IF you want high availability, you will need to install on Enterprise and above versions of windows server.
: - Startup Server Manager and click Add roles and features








: - Install Web Server (IIS) Proper Install

























: - Install ASP.NET 3.5. You will need the windows server DVD mounted in the dvd drive or else use the alternative path and point to the sources\sxs folder of the windows server dvd















: - Enable Windows Update
















: - Ensure Remote Registry is enabled Set Remote Registry to Automatic
    






: - Download Windows Server AppFabric here
Double click the downloaded executable and click next to everything, you might want to install the whole suite just to play safe




















: - Installation should be successful and you will be greeted with the following screen















: - After Installing Facing the Below Error.
Windows Server AppFabric is not correctly configured. You Should uninstall Windows Server Appfabric and reinstall it using The SharePoint Products Preparation Tool.













: - Uninstall AppFebric 1.1 for Windows Server.





: - Now Reinstall Windows SharePoint.

SQL TIPS AND TRICKS

Trick 1: -
If your any Database moving on Single User, then apply this Query:
ALTER DATABASE [Database Name] SET MULTI_USER
GO

Trick 2: -
If you facing your SQL database drive is full and there is no space, then apply this
Query:
USE MicrosoftDynamicsAX;
ALTER DATABASE MicrosoftDynamicsAX
SET RECOVERY SIMPLE;
DBCC SHRINKFILE (MicrosoftDynamicsAX_log, 0);
ALTER DATABASE MicrosoftDynamicsAX
SET RECOVERY FULL

Trick 3: -
If you want any database table copy and paste any database, then apply this Query:
select * into [Database Destination Name].dbo.[Table Name] from [Table Name]


Trick 4: -
Install Particular Instance SQL Reporting Extension apply the Query:

Install-AXReportInstanceExtensions –ReportServerInstanceName [SSRSInstanceName] -Credential [DomainName\UserName]



Trick 5: -
Create server session and Create user session

Create server session

USE [YourDatabaseNameGoesHere]
GO
/****** Object: StoredProcedure [dbo].[CREATESERVERSESSIONS]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE procedure [dbo].[CREATESERVERSESSIONS] @aosId varchar(50), @version int, @instanceName nvarchar(50), @recid bigint, @maxservers int, @status int, @loadbalance int, @workload int, @serverid int OUTPUT as declare @first as varchar(50) declare @max_val as int begin select top 1 @first = SERVERID from SYSSERVERSESSIONS WITH (UPDLOCK, READPAST) where STATUS = 0 and AOSID = @aosId and INSTANCE_NAME = @instanceName if (select count(SERVERID) from SYSSERVERSESSIONS where SERVERID IN (@first)) > 0 begin update SYSSERVERSESSIONS set AOSID = @aosId, VERSION = @version, INSTANCE_NAME = @instanceName, LOGINDATETIME = dateadd(ms, -datepart(ms,getutcdate()), getutcdate()), LASTUPDATEDATETIME = dateadd(ms, -datepart(ms,getutcdate()), getutcdate()), STATUS = @status, WORKLOAD = @workload where SERVERID IN (@first) and ((select count(SERVERID) from SYSSERVERSESSIONS where STATUS = 1 and LOADBALANCE = 0) < @maxservers) if @@ROWCOUNT = 0 select @serverid = 0 else select @serverid = @first end else begin if (select count(SERVERID) from SYSSERVERSESSIONS WITH (UPDLOCK) where STATUS = 1 and LOADBALANCE = 0) >= @maxservers select @serverid = 0 else begin if (select count(SERVERID) from SYSSERVERSESSIONS) = 0 select @max_val = 1 else select @max_val = max(SERVERID)+1 from SYSSERVERSESSIONS insert into SYSSERVERSESSIONS(SERVERID, AOSID, INSTANCE_NAME, VERSION, LOGINDATETIME, LASTUPDATEDATETIME, STATUS, RECID, LOADBALANCE, WORKLOAD) values(@max_val, @aosId, @instanceName, @version, dateadd(ms, -datepart(ms,getutcdate()), getutcdate()), dateadd(ms, -datepart(ms,getutcdate()), getutcdate()), @status, @recid, @loadbalance, @workload) select @serverid = @max_val end end end

Create user session

USE [YourDatabaseNameGoesHere]
GO
/****** Object: StoredProcedure [dbo].[CREATEUSERSESSIONS]
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO

CREATE procedure [dbo].[CREATEUSERSESSIONS] @clientType int, @sessionType int, @serverid int, @versionid int, @userid varchar(5), @lanExt varchar(10), @manExt varchar(10), @sid varchar(124), @recid bigint, @startId int, @maxusers int, @licenseType int, @masterId int, @maxClientId int, @sessionid int OUTPUT, @loginDateTime datetime OUTPUT as declare @return_val as int declare @first as int declare @max_val as int begin select @sessionid = -1 select @max_val = -1 select @loginDateTime = dateadd(ms, -datepart(ms,getutcdate()), getutcdate()) if(not exists(select * from SYSSERVERSESSIONS WITH (NOLOCK) where SERVERID = @serverid AND Status = 1)) begin select @sessionid = -2 return end select @first = min(SESSIONID) from SYSCLIENTSESSIONS WITH (UPDLOCK,READPAST) where STATUS = 0 and SESSIONID > @maxClientId and SESSIONID <> @masterId if (select count(*) from SYSCLIENTSESSIONS where SESSIONID IN (@first)) > 0 begin if (@licenseType = 0) begin update SYSCLIENTSESSIONS set STATUS = 1, VERSION = @versionid, SERVERID = @serverid, USERID = @userid, LOGINDATETIME = @loginDateTime, SID = @sid, USERLANGUAGE = @lanExt, HELPLANGUAGE = @manExt, CLIENTTYPE = @clientType, SESSIONTYPE = @sessionType where SESSIONID IN (@first) end else if (@licenseType = 1) begin update SYSCLIENTSESSIONS set STATUS = 1, VERSION = @versionid, SERVERID = @serverid, USERID = @userid, LOGINDATETIME = @loginDateTime, SID = @sid, USERLANGUAGE = @lanExt, HELPLANGUAGE = @manExt, CLIENTTYPE = @clientType, SESSIONTYPE = @sessionType where SESSIONID IN (@first) and ((select count(SESSIONID) from SYSCLIENTSESSIONS where CLIENTTYPE = @clientType and ((STATUS = 1) or (STATUS = 2))) < @maxusers) end else if (@licenseType = 2) begin update SYSCLIENTSESSIONS set STATUS = 1, VERSION = @versionid, SERVERID = @serverid, USERID = @userid, LOGINDATETIME = @loginDateTime, SID = @sid, USERLANGUAGE = @lanExt, HELPLANGUAGE = @manExt, CLIENTTYPE = @clientType, SESSIONTYPE = @sessionType where SESSIONID IN (@first) and ( (select count(SESSIONID) from SYSCLIENTSESSIONS where CLIENTTYPE = @clientType and (USERID = @userid) and ((STATUS = 1) or (STATUS = 2))) > 0 or (select count(distinct USERID) from SYSCLIENTSESSIONS where CLIENTTYPE = @clientType and ((STATUS = 1) or (STATUS = 2))) < @maxusers ) end if @@ROWCOUNT = 0 select @sessionid = 0 else select @sessionid = @first end else begin if (@licenseType = 1) begin if (select count(SESSIONID) from SYSCLIENTSESSIONS where CLIENTTYPE = @clientType and ((STATUS = 1) or (STATUS = 2))) >= @maxusers select @sessionid = 0 end else if (@licenseType = 2) begin if ( ((select count(distinct USERID) from SYSCLIENTSESSIONS where CLIENTTYPE = @clientType and ((STATUS = 1) or (STATUS = 2))) >= @maxusers) and ((select count(SESSIONID) from SYSCLIENTSESSIONS where CLIENTTYPE = @clientType and (USERID = @userid) and ((STATUS = 1) or (STATUS = 2))) = 0) ) select @sessionid = 0 end if (@sessionid = -1) or (@licenseType = 0) begin if (select count(SESSIONID) from SYSCLIENTSESSIONS WITH (UPDLOCK) where STATUS = 0 or STATUS = 1 or STATUS = 2 or STATUS = 3) = 0 select @max_val = @startId else select @max_val = max(SESSIONID)+1 from SYSCLIENTSESSIONS WITH (UPDLOCK) if (@max_val > 65535) select @sessionid = -3 else begin insert into SYSCLIENTSESSIONS(SESSIONID, SERVERID, VERSION, LOGINDATETIME, USERID, SID, USERLANGUAGE, HELPLANGUAGE, CLIENTTYPE, SESSIONTYPE, RECID, CLIENTCOMPUTER, STATUS) values(@max_val, @serverid, @versionid, @loginDateTime, @userid, @sid, @lanExt, @manExt, @clientType, @sessionType, @recid, '', 1) if @@ROWCOUNT = 0 select @sessionid = -1 else select @sessionid = @max_val end end end end



Trick 6: -
Install Reporting extension in Particular instance
Install-AXReportInstanceExtensions –ReportServerInstanceName [SSRSInstanceName] -Credential [DomainName\UserName]

Trick 7: -
Copy and Paste SQL Database Table another Database
select * into [Database Destination Name].dbo.[Table Name] from [Table Name]

Trick 8: -
Deploy Reports in Particular Instance in Microsoft Dynamics AX
  • Publish-AXReport -ServicesAOSName [AOSSERVER] -ServicesAOSWSDLPORT [8101] -ReportName *
  • Publish-AXReport –Id [SSRSConfigID] –ReportName *

  • Publish-AXReport –ReportName * -id [AXSSRS] –servicesAOSname [AOSServer] –servicesAOSWSDLPort [8102]
Trick 9: -
If Your database in Restoring Mode. Now apply this Query.
  • Restore Database [Database Name] With Recovery

Claims to Windows Token Service in SharePoint Central Administration - AX 2012 R3 EP installation warning / error

  • Claims to Windows Token Service in SharePoint Central Administration Sol:

  • Share point central administration -> System settings> Manage services on server

  • Start the Climes to windows token service












To check Default Share point portal:

http://axapp/sites/DynamicsAx/EmployeeServices/

Tuesday 24 January 2017

Windows Commands Line

Get serial number for RAM, motherboard, hard disk

This post explains how to find serial number for various hardware devices – RAM, Hard disk, Motherboard on a computer. We can use WMIC command to find this information.  These commands can be executed from Windows command prompt.

Get serial number of RAM chips.

wmic memorychip get serialnumber
This command lists serial number for each RAM module installed on the computer. Example below.
c:\>wmic memorychip get serialnumber
SerialNumber
91AB9A10
9EBD9A10

Get serial number for hard disks

wmic diskdrive get serialnumber
Example:
c:\>wmic diskdrive get serialnumber
SerialNumber
FR3AG13032430BC13S

Get serial number for mother boards

wmic baseboard get serialnumber

 

Get Serial number for cdrom drive

wmic cdrom where drive='d:' get SerialNumber
Replace ‘d:’ with the drive letter for the cdrom on your computer. You get error ‘No Instance(s) available’ if you don’t have CDROM drive on your computer.
c:\>wmic cdrom  get SerialNumber
No Instance(s) Available.

MAC address command














Get SID of a local user
wmic useraccount where name='username' get sid
For example, to get the SID for a local user with the login name  ‘John’, the command would be as below:

wmic useraccount where name='John' get sid

SID for current logged in domain user
Run the command ‘whoami /user’ from command line to get the SID for the logged in user.
Example:
c:\>whoami /user
USER INFORMATION
----------------
User Name      SID
============== ==============================================
mydomain\wincmd S-1-5-21-7375663-6890924511-1272660413-2944159
c:\>


Get SID for the local administrator of the computer
wmic useraccount where (name='administrator' and domain='%computername%') get name,sid

Get SID for the domain administrator
wmic useraccount where (name='administrator' and domain='%userdomain%') get name,sid

Find username from a SID
Now this is tip is to find the user account when you have a SID. One of the readers of this post had this usecase and he figured out the command himself with the help of the commands given above. Adding the same here.
wmic useraccount where sid='S-1-3-12-1234525106-3567804255-30012867-1437' get name

Find any installed windows updates
command 1.      [wmic qfe list]

command 2. [systeminfo | find ": KB"]


Windows native commands

Schedule tasks
Set file attributes
Enable kernel debugging
Copy files
Compress or decompress files and directories
Echo the command/contents of a file
Set system date and time
Delete files
List files and directories
View events
Search files for a given string
Search files for a given string; Has advanced options than find command.
Windows batch command for looping
Find mac address of the system
Get system name
Logoff user session
Create directories
More command. Similar to Linux more command
Manage user accounts
Create/List/Delete network drives
Manage local computer’s user groups
Create / List/ Delete shares on the local computer
Edit/create/delete registry keys
Rename files
Rename directories
Delete directories
Copy large number of files/folders
Run an application as a different user in the same session
Schedule tasks
Shutdown computer
Shutdown remote computer
Command for sorting text files
Get computer information
List processes
Kill processes
Cat command for Windows. Prints the contents of file on command window
Copy files and directories