Sunday, January 29, 2017

TMG Error: 0xc004032a

TMG Error 0xc004032a when clicking on domain tab


To resolve this problem open ADSIedit and connect to TMG server. If you have TMG Array connect to TMG Config Storage server.

Select Distingushed Name or Naming Context” - CN=fpc2
“Select or type a domain or server that you logged in to” : <TMG_Server>:2171 or localhost:2171

Navigate:

  •  CN=Array-Root

  •  CN=Arrays

  •  CN={Array’e ait olan GUID}

  •  CN=NetConfig

  •  CN=Networks

  •  CN={Network’e ait olan GUID} 

  •  CN=Proxy-LDT

You can see domain names against msFPCName in all related GUIDs, and delete dublicates.



Saturday, January 28, 2017

Publish New Certificate Revocation List (CRL) from Offline Root CA to Active Directory and Inetpub

Publish New Certificate Revocation List (CRL) from Offline Root CA to Active Directory and Inetpub

  1. Turn on the Offline Root CA and login with Admin account
  2. Open the Certification Authority Console
  3. Right Click on the "Revoked Certificates" and click Properties.
  4. Set “CRL Publish interval” to a large value (Default is 26 Weeks) and  uncheck “Publish Delta CRL” check-box.

In order to Publish a new CRL from the offline Root CA to the Enterprise Sub CA you need to do the following:

  1. Publish a new CRL on the Root CA, this can be done by Right Click the "Revoked Certificates" - All Tasks - Publish      
  2. Copy the CRL file from the Root CA located under %systemroot%\system32\certsrv\certenroll to the Sub CA Server
  3. Turn off the Root CA
  4. Copy the above file to the InetPub folder (HTTP Path) in the Sub CA server which is by default located under the C:\inetpub\wwwroot\Certdata
  5. Open an Admin Command Prompt and run the following command to publish it to the Active Directory (LDAP Path).                                                                                           
certutil -f -dspublish " C:\Inetpub\wwwroot\certdata\RootCA.crl      


Source                                                                                                                                            

Friday, January 27, 2017

Office Web Apps 2013 -2016 Server Install and Configuration

Office Web App

Sharepoint side :

get-SPWOPIBinding - show ofiice web app configuration

Remove-SPWOPIBinding -All:$true -remove office web app from sharepoint

New-SPWOPIBinding -ServerName "OfficewebAppServer FQDN"-AllowHtp- connect sharepoint to owa server

Set-SPWOPIZone -zone "external-https" - use if  users  have external and internal connection

Set-SPWOPIZone -zone "internal-http" - use if  you  have only internal connection

An update conflict has occurred, and you must re-try this action. The object SearchServiceApplication Name={FAST SSA} was updated by {account}, in OWSTIMER (5836) process, on machine {server name}.

An update conflict has occurred, and you must re-try this action. The object SearchServiceApplication Name={FAST SSA} was updated by {account}, in OWSTIMER (5836) process, on machine {server name}.


1. Stop the SharePoint timer service. My  preference is command prompting this: net stop sptimerv4
2. Locate the SharePoint cache folder: \ProgramData\Microsoft\SharePoint\Config\{Guids Folders} . Locate the Guid folder that contains a file called cache.ini. We won’t delete this file. We will delete all files in the folder (but the cache.ini). Recycle bin them if you’re feeling better. Edit the cache.ini file and replace the number in it with something else.
3. Restart the SharePoint timer service, net start sptimerv4
4. Watch the cache (Guid folder) cleaned in step 2 being repopulated with files. Check the cache.ini file’s content, your temporary value will be gone.

An update conflict has occurred, and you must re-try this action

Cannon Add Web application.

An update conflict has occurred, and you must re-try this action

An update conflict has occurred, and you must re-try this action. The object SPAlternateUrlCollection Name=WEBAPPLICATION Parent=SPFarm Name=SharePoint_Config is being updated by DomainName\UserName1, in the w3wp process, on machine ServerName. View the tracing log for more information about the conflict.


  1. Stop the Timer service. To do this, follow these steps:
    1. Click Start, point to Administrative Tools, and then click Services.
    2. Right-click Windows SharePoint Services Timer, and then click Stop.
    3. Close the Services console.
  2. On the computer that is running Microsoft Office SharePoint Server 2007 and on which the Central Administration site is hosted, click Start, click Run, type explorer, and then press ENTER.
  3. In Windows Explorer, locate and then double-click the following folder:
    Drive:\Documents and Settings\All Users\Application Data\Microsoft\SharePoint\Config\GUID
    Notes
    • The Drive placeholder specifies the letter of the drive on which Windows is installed. By default, Windows is installed on drive C.
    • The GUID placeholder specifies the GUID folder.
    • The Application Data folder may be hidden. To view the hidden folder, follow these steps:
      1. On the Tools menu, click Folder Options.
      2. Click the View tab.
      3. In the Advanced settings list, click Show hidden files and folders under Hidden files and folders, and then click OK.
    • In Windows Server 2008, the configuration cache is in the following location:
      Drive:\ProgramData\Microsoft\SharePoint\Config\GUID
  4. Back up the Cache.ini file.
  5. Delete all the XML configuration files in the GUID folder. Do this so that you can verify that the GUID folder is replaced by new XML configuration files when the cache is rebuilt. 

    Note When you empty the configuration cache in the GUID folder, make sure that you do not delete the GUID folder and the Cache.ini file that is located in the GUID folder.
  6. Double-click the Cache.ini file.
  7. On the Edit menu, click Select All.
  8. On the Edit menu, click Delete.
  9. Type 1, and then click Save on the File menu.
  10. On the File menu, click Exit.
  11. Start the Timer service. To do this, follow these steps:
    1. Click Start, point to Administrative Tools, and then click Services.
    2. Right-click Windows SharePoint Services Timer, and then click Start.
    3. Close the Services console.
    Note The file system cache is re-created after you perform this procedure. Make sure that you perform this procedure on all servers in the server farm.
  12.  Make sure that the Cache.ini file has been updated. For example it should no longer be 1 if the cache has been updated.
  13. Click Start, point to Programs, point to Administrative Tools, and then click SharePoint 3.0 Central Administration.
  14. Click the Operations tab, and then click Timer job status under Global Configuration.
  15. In the list of timer jobs, verify that the status of the Config Refresh entry is Succeeded.
  16. On the File menu, click Close.


View IIS Errors


Open Web.config file on the IIS  site -> There you need to search for CallStack and change CallStack = “true” 
Similarly search for CustomError and change CustomError =”Off” 

That’s it you can now browse the page where you are facing the issue and then you will be able to know the root cause of the error and then accordingly handle it.

Tuesday, January 24, 2017

Send Mail from CMD

telnet localhost smtp
HELO yahoo.com
mail from: sender@test.com
250 2.1.0 sender@tecadmin.net... Sender ok
rcpt to: myemail@mail.com
250 2.1.5 myemail@mail.com... Recipient ok
data
354 Enter mail, end with "." on a line by itself
Hey
This is test email only

Thanks
.
250 2.0.0 r9M95xgc014513 Message accepted for delivery
quit
221 2.0.0 fbreveal.com closing connection
Connection closed by foreign host.

Monday, January 23, 2017

Powershell script to get users logged in in last 30 days

Powershell script to get users logged in in last X days

get-aduser -filter {lastlogondate -gt "8/1/2013"} -Properties lastlogondate | select Name,LastLogonDate | sort name


(get-aduser  -server contoso.com -filter {lastlogondate -gt "8/1/2013"} -Properties lastlogondate).count

Tuesday, January 17, 2017

Cann't connect Admin Share member of administrators group

\\servername\c$
Can connect to it using the default Administrator account. But if I try to connect using  account that is a member of the Administrators group,  can't.
create the LocalAccountTokenFilterPolicy DWORD value at this key in the registry
HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system\
0 - build filtered token (Remote UAC enabled) 
1 - build elevated token (Remote UAC disabled)

or you can add this key from CMD :

reg add HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\system /v LocalAccountTokenFilterPolicy /t REG_DWORD /d 1 /f

Friday, January 13, 2017

Remove IIS Logs Script

Script to remove IIS logs:


$start = (get-date).AddDays(-30) 
Get-ChildItem -Path c:\inetpub\logs\logfiles\w3svc*\*.log | where {$PSItem.LastWriteTime -lt $start} | Remove-Item

Add this sctipt to windows scheduler, and logs will be remove automatically!