Tuesday, April 14, 2020

SelfService sitecollections in Sharepoint 2019

With Sharepoint 2019 we now have the ability to allow users to create site collections outside their own mysite themselves. This allows for less administration.
The drawback of this solution is that you can only create managed path sites on primary Alternate Access for webapplication. 
Microsofts documentation leaves some holes in regards to how to activate selfservicing functions with powershell in Sharepoint 2019 so I digged for the related values and found settings below. Most are obvious, one wasn't.


Script below




References:
https://docs.microsoft.com/en-us/sharepoint/sites/configure-self-service-site-creation-in-sharepoint-server-2019

Friday, January 31, 2020

Blobcache issues

I had some weird problem with images in Sharepoint 2013.
Issues were for example
  • Updated images didn't work, old images still showed for clients. 
  • Change imageproperties didn't work either
  • Changing website logo didn't work
BlobCache quickly became as suspect, so we tried to flush the blobcache the proper way with flushBlobCache.ps1 but the folders in the blobcache-directory didn't get recreated.
Expected behaviour is when flushblob has run on farm, the folder under siteID in blob-directory will get a new created date and new name.
For me, they just left the old folder without change on certain farm-members.

After searching for a official solution I landed on my own fix which was as follows
  1. Redirect trafik from webfrontend or do this during servicewindow
  2. Update url and run setBlobDisabled.ps1 (or disable blob manually in web.config)
  3. This will cause a reset to Application Pool and blobfolder will stop updating change.bin file in blob temp-directory
  4. Rename or delete folder with SiteID, for example E:\Blob\14\354006434 to 354006434_old
  5.  Update url and run setBlobEnabled.ps1
  6. Problem solved.


 

Wednesday, January 08, 2020

Checking Dotnet version on server

I needed to check running dotnet version on a few servers to verify support for TLS 1.2
I used script below, which I though was easy to update and using hash-tables in an effective way.



Friday, August 30, 2019

Using powershell to check company information

I had a long list of companynames but no homepage adress.
Using the swedish yellow pages service Eniro I could use powershell to get the information.
This script only gets the first result with homepage attribut added, but depending on what you put the results may vary.



Tuesday, June 18, 2019

Checkup list of websites

To determine a range of websites dns, registrar and IPOwner and what technology is used the following script can be used.
Note that whois64.exe referred to in script needs to be downloaded seperatly from Sysinternals/Microsoft



References:
https://docs.microsoft.com/en-us/sysinternals/downloads/whois

Thursday, February 07, 2019

enumerate columns from subsites

This case is something which I've came back to a few times.
Customer wants to output columns from certain content types from a number of sites.
Its always a hassle to get the correct names of columns so I've built a method to output the values more dynamically.

1. First getFields.ps1 reads columns containg values from a list item, outputs to gridview, chosen values gets saved to customfields.csv
2. Second getSitecontenttypefields.ps1 enumerates all sites on chosen destination and loops all items of specified content types and outputs chosen fields from customfields.ps1 to an object which is saved to a csv-file.




Thursday, December 20, 2018

CertAuto

For a developer environment I had a few certificates that needed automatic renewal at certain intervals. The script below uses the PSPKI module to check if certificates are expiring on IIS-Site in X days and if so, renews the agains a local certification authority.
The PSPKI -module is really god for sending and approving certification requests  via Powershell when Microsofts own tools leaves room for improvement.

This is really only for a testenviroment and offline-enviroments.
Folder structure needs to created to look below




Certini contains the template for the certificate like below for example
 [Version]
Signature = "$Windows NT$"
[NewRequest]
Subject = "C=US,S=CA,L=OHIO,O=Fabrikam,OU=IT,CN=ajax.aspnetcdn.com"
Exportable = TRUE
KeyLength = 4096
KeySpec = 1
KeyUsage = 0xa0
MachineKeySet = True
ProviderName = "Microsoft RSA SChannel Cryptographic Provider"
ProviderType = 12
Silent = True
SMIME = False
RequestType = PKCS10
FriendlyName = "ajax.aspnetcdn.com"



References:
https://www.sysadmins.lv/projects/pspki/default.aspx  - PSPKI Module

Powershell and Uptimerobot

Uptimerobot can be quite tedious when you need to update many monitors at once. For example say you bought the license for Uptimerobot and n...