Skip Ribbon Commands
Skip to main content

Blog

:

Home
April 16
Powershell examples

​ 

Add-PSSnapin microsoft.exchange.management.powershell.e2010
 
 
Restart:
 
$services = Get-Service | ? { $_.name -like "MSExchange*" -and $_.Status -eq "Running"}
 
foreach ($service in $services) {Restart-Service $service.name -Force}
 
 
 
 
 
 
New-Mailbox -UserPrincipalName jaap@4k.local -Alias Jaap -Database "Mailbox Database 2103569434" -Name Jaap -OrganizationalUnit Users -FirstName Jaap -LastName Jansen -DisplayName "Jaap Jansen"
 
Will give password prompt!
 
 
 
Get-Help New-Mailbox -examples
 
Get-Mailbox
Get-Mailbox | Format-List
Get-Mailbox | fl
Get-Mailbox | Format-Table
Get-Mailbox | ft Name, Database, IssueWarningQuota
 
 
Get-MailboxStatistics -Server Exch2010
 
Get-MailboxStatistics   -Server Exch2010| where {$_.ObjectClass –eq “Mailbox”} | Sort-Object TotalItemSize –Descending | ft @{label=”User”;expression={$_.DisplayName}},@{label=”Total Size (MB)”;expression={$_.TotalItemSize.Value.ToMB()}},@{label=”Items”;expression={$_.ItemCount}},@{label=”Storage Limit”;expression={$_.StorageLimitStatus}} -auto
 
 
  • get-mailbox | set-CASmailbox -PopEnabled $false
 
 
 
New-MailboxDatabase -name RDB -Server exch2010 -EdbFilePath "D:\restore folder\Mailbox Database 2103569434.edb" -LogFolderPath "D:\restore folder" -Recovery
 
 
 
Get-AutodiscoverVirtualDirectory | ft Identity,InternalURL,ExternalUrl
 
Get-webservicesVirtualDirectory | ft Identity,InternalURL,ExternalUrl
 
Get-OabVirtualDirectory | ft Identity,InternalURL,ExternalUrl
 
Get-OwaVirtualDirectory | ft Identity,InternalURL,ExternalUrl
 
Get-EcpVirtualDirectory | ft Identity,InternalURL,ExternalUrl
 
Get-ActiveSyncVirtualDirectory | ft Identity,InternalURL,ExternalUrl
 
 
 
Set the Internal URLs.
 
 
Get-AutodiscoverVirtualDirectory | Set-AutodiscoverVirtualDirectory –InternalUrl “https://mail.domain.com/Autodiscover/Autodiscover.xml
 
Get-ClientAccessServer | Set-ClientAccessServer –AutodiscoverServiceInternalUri “https://mail.domain.com/Autodiscover/Autodiscover.xml
 
Get-WebservicesVirtualDirectory | Set-WebservicesVirtualDirectory –InternalUrl “https://mail.domain.com/Ews/Exchange.asmx
 
Get-OabVirtualDirectory | Set-OabVirtualDirectory –InternalUrl “https://mail.domain.com/Oab
 
Get-OwaVirtualDirectory | Set-OwaVirtualDirectory –InternalUrl “https://mail.domain.com/Owa
 
Get-EcpVirtualDirectory | Set-EcpVirtualDirectory –InternalUrl “https://mail.domain.com/Ecp
 
Get-ActiveSyncVirtualDirectory -Server $CASserver | Set-ActiveSyncVirtualDirectory -InternalUrl “https://mail.domain.com/Microsoft-Server-ActiveSync
 
5.) Set the External URLs.
 
 
Get-AutodiscoverVirtualDirectory | Set-AutodiscoverVirtualDirectory –ExternalUrl “https://mail.domain.com/Autodiscover/Autodiscover.xml
 
Get-webservicesVirtualDirectory | Set-webservicesVirtualDirectory –ExternalUrl “https://mail.domain.com/Ews/Exchange.asmx
 
Get-OabVirtualDirectory | Set-OabVirtualDirectory –ExternalUrl “https://mail.domain.com/Oab
 
Get-OwaVirtualDirectory | Set-OwaVirtualDirectory –ExternalUrl “https://mail.domain.com/Owa
 
Get-EcpVirtualDirectory | Set-EcpVirtualDirectory –ExternalUrl “https://mail.domain.com/Ecp
 
Get-ActiveSyncVirtualDirectory | Set-ActiveSyncVirtualDirectory -ExternalUrl “https://mail.domain.com/Microsoft-Server-ActiveSync

March 20
CSS toplinkbar

/* Navigation list */
.s4-tn{
 
 background-color:#00557B;
 padding:0px; margin:0px;
 }
 /* Global navigation */
 .s4-tn li.static > .menu-item{
 color:#fff; white-space:nowrap;
 border:1px solid transparent;
 padding:44px 10px;
 line-height:25px;
 height:28px;
 padding-left:30px;
 padding-right:30px;
 }
 /* Hover */
 .s4-tn li.static > a:hover{
 background:url("/_layouts/Inc/expand.png");
 background-repeat:no-repeat;
   background-position:left;
 background-color:#0087C1;
 color:#000; text-decoration:none;
 }
 /* Selected */
 .s4-toplinks .s4-tn a.selected{
 background:url("/_layouts/Inc/expand.png");
 background-repeat:no-repeat;
   background-position:left;
 background-color:#0087C1;
 color:#fff; text-decoration:none;
 border:1px transparent solid;
 padding-right:30px;
 padding-left:30px;
 margin:0px;
 }
 
}

​-------------------------------

 

/* Navigation list */
.s4-tn{
background-color:#00557B;
padding:0px; margin:0px;
}
/* Global navigation */
.s4-tn li.static > .menu-item{
color:#fff; white-space:nowrap;
border:1px solid transparent;
padding:4px 10px;
line-height:25px;
height:28px;
}
/* Hover */
.s4-tn li.static > a:hover{
background:url("/_layouts/Images/selbg.png") repeat-x left top;
background-color:#0087C1;
color:#000; text-decoration:none;
}
/* Selected */
.s4-toplinks .s4-tn a.selected{
background:url("/_layouts/Images/selbg.png") repeat-x left top;
background-color:#0087C1;
color:#fff; text-decoration:none;
border:1px transparent solid;
padding-right:10px;
padding-left:10px;
margin:0px;
}

March 19
Change Add new annoucement to add new News Item

​voor taken lijst

 

<script>
var ttnA = document.getElementsByTagName('A');
for (var j=0; j<ttnA.length; j++)
{
  if (ttnA[j].id == 'idHomePageNewItem')
  {
    ttnA[j].innerHTML='your new text goes here'
  }
}
</script>

voor announcements

 

http://techtrainingnotes.blogspot.com/2010/08/sharepoint-2010-change-add-new-item-and.html

March 19
Open in New Window  use the XSLT view

​  

replace

 

<a onfocus="OnLink(this)" href="{$url}">

 

with

 

<a onfocus="OnLink(this)" href="javascript:void();" onclick="window.open('{$url}');">

March 19
Quicklaunch hidden style

<style type="text/css">

/*--Hide Quick Launch --*/
#s4-leftpanel{ display:none}
.s4-ca{margin-left:0px}

</style>

March 07
CRM 2011 Mail Merge Javascript

function StartWord()
{
 
// Start a new instance of Microsoft Word
var MsWord = new ActiveXObject('Word.Application');
// Make Word visible
MsWord.Visible=true;
// Name and open document
MSDoc = MsWord.Documents.Open("d:\\test.docx");
 
// transfer field values to cdp
 
 
var Tekst = Xrm.Page.getAttribute("name").getValue();
if (Tekst =! null) {
MsWord.ActiveDocument.CustomDocumentProperties("name") =Xrm.Page.getAttribute("name").getValue();}
 
Tekst = Xrm.Page.getAttribute("address1_line2").getValue();
if (Tekst =! null) {
MsWord.ActiveDocument.CustomDocumentProperties("adres").value =Xrm.Page.getAttribute("address1_line2").getValue();}
 
Tekst = Xrm.Page.getAttribute("address1_postalcode").getValue();
if (Tekst =! null) {
MsWord.ActiveDocument.CustomDocumentProperties("postcode").value =Xrm.Page.getAttribute("address1_postalcode").getValue();}
 
Tekst = Xrm.Page.getAttribute("address1_city").getValue();
if (Tekst =! null) {
MsWord.ActiveDocument.CustomDocumentProperties("plaats").value =Xrm.Page.getAttribute("address1_city").getValue();}
 
 
 
MsWord.WindowState=2;
 
MsWord.ActiveDocument.Fields.Update();
 
}

//met dank ​aan Arnold van Loon van JSR Zoetermeer!

 

February 22
CRM 2011 Tooltip (oude syntax werkt)

​function tooltip()

{

crmForm.all.fax_c.title = "Fax nummer moet beginnen met landcode";

}

February 22
CRM 2011 Javascript required if

function required()
{
var  land = Xrm.Page.getAttribute("address1_country").getValue();

if(land == "Nederland") 
 { 
     Xrm.Page.getAttribute("btwnummer").setRequiredLevel("required");
     Xrm.Page.getAttribute("debnummer").setRequiredLevel("required");
 } 
}

 

February 22
CRM 2011 First character to uppercase

​function hoofdletter()
{
var  sAttribute = Xrm.Page.getAttribute("firstname").getValue();
sAttribute = sAttribute.charAt(0).toUpperCase() + sAttribute.slice(1).toLowerCase();
Xrm.Page.getAttribute("firstname").setValue(sAttribute);
}

December 16
CRM 2011 Javascript veldaanpassen

​function veldaanpassen()

{

Xrm.Page.getAttribute("address1_city").setValue("Rotterdam");

}

1 - 10Next
 

 About this blog

 
About this blog
Welcome to SharePoint Blogs. Use this space to provide a brief message about this blog or blog authors. To edit this content, select "Edit Page" from the "Site Actions" menu.